Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Search box css for compact size #1407

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Dec 8, 2022

Issue #1398

This SearchBox component already had the ResizeAware functionality applied to it

576px is used elsewhere in the SearchBox component for the 'compact size' version

@@ -90,6 +91,10 @@ class SearchBox extends Component {
return this.state.tagWidth + existingPadding;
}

calculateInputRightPadding() {
return this.state.width < 576 ? 121 : 264;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do 121 and 264 come from? These seem like arbitrary numbers. Maybe add a comment indicating what this is actually doing?

Copy link
Member Author

@emteknetnz emteknetnz Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment of the 'x' that shows in chrome and matches the location of it in 4.11

image

image

Have added comment

Comment on lines -194 to +204
const style = { paddingLeft: `${this.calculateInputLeftPadding()}px` };
const style = {
paddingLeft: `${this.calculateInputLeftPadding()}px`,
paddingRight: `${this.calculateInputRightPadding()}px`
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why both left and right, but before it was only doing left padding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right padding was added to fix the bug :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From memory it was because there's an "x" that shows when you type in the text input in chrome, and without the right padding change it was totally out of alignment after the search button text was removed

@GuySartorelli GuySartorelli merged commit 03d829f into silverstripe:1.12-release Dec 12, 2022
@GuySartorelli GuySartorelli deleted the pulls/1.12/button-resize branch December 12, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants