-
Notifications
You must be signed in to change notification settings - Fork 592
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
SelectPanel2: Only show clear action in search with text #4146
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
size-limit report 📦
|
// '& input:empty + .TextInput-action': {display: 'none'}, | ||
} | ||
} | ||
sx={{'&:has(input:placeholder-shown) .TextInput-action': {display: 'none'}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this was fun! was able to use a new css feature and a really old css feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
One tiny comment: I know this is nitpicking but I just want to mention. I don't think placeholder
is an exposed prop in the API but funny thing is that when the placeholder=''
instead of placeholder='Search'
, the css logic works as expected in Chrome but not in Safari. In Safari, when the placeholder is an empty string, the clear action is visible. I found out while I was like 'Ohh placeholder-shown
, let me play with this' 😄
Clear action is only visible when there is something to clear
selectpanel-clear-action.mov