-
Notifications
You must be signed in to change notification settings - Fork 601
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
Remove placeholder when active selected items #1029
Comments
You can achieve this with CSS, e.g.: .choices__list--multiple:not(:empty) + .choices__input::placeholder {
opacity: 0;
} Should you want to achieve something similar with a single select, you could do it like so: .choices__list--dropdown > .choices__list > .choices__placeholder {
display: none;
} |
@ggsp Thanks for the css magic. it does indeed hide the placeholder. This only kind of worked for me as the placeholder is still taking up space. For me both the base implementation and this workaround do not function like a normal element placeholder would which is what I am going for. I'm sure there's a way to do it in css but for those who want to handle via JS this is how I ended up handling it:
|
Thanks @ggsp You saved a tone of time ❤️ |
dphaas2004's solution did not work for me but it did put me on the path towards finding it (for my project) so I thought I'd include it on this post HTML Filter:
JS code:
Hopefully this is helpful to anyone else! |
Whenever there is an item selected in the "multiple" dropdown, i'd like to have the placeholder option removed from the list.
This is to have a indicator like "Please select your ...."
Now it always shows this placeholder, even if there are selected items
The text was updated successfully, but these errors were encountered: