-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Dropdown] Reset / Clear icon for Semantic UI single selection dropdown. #3635
Comments
Yes, as shown in my example? |
Unusual but functional. Add to enhancement. |
It looks nice, could be useful as an option. I added a couple of suggestions to consider:
$('.ui.dropdown .remove.icon').on('click', function(e){
$(this).parent('.dropdown').dropdown('clear');
console.log('clear');
e.stopPropagation();
});
.ui.dropdown input[value=''] ~ .remove.icon, .ui.dropdown input:not([value]) ~ .remove.icon
{
opacity: 0.0;
} |
Thanks for the work. I noticed it doesn't work if the dropdown is searchable so I added some CSS rules to move the search input a bit to the right and to align nicely the default text:
I also added support when the dropdown is in loading state. The problem was that the CSS loading rules applied to both icons thus resulting in two spinning circles.
|
We definitively need this as an option :) |
I prefer it on the right side, before the dropdown icon. It simplifies the styling as well. https://jsfiddle.net/dbr26njq/287/ Edit: |
Using only js/jquery |
This is dope. I'm using this in my project. It would be very cool to have this as an official option. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
Bump ... This is a necessary enhancement. |
i wanna this feature too, something like react-select will be cool |
Has this been included in the react-version yet? |
I needed an easy way to clear a single selection dropdown, so I came up with this example (select an option, then click the remove icon on the left to clear the selected value) :
https://jsfiddle.net/kmd1970/hgufwj03/
I wish this feature was included in Semantic UI. Users need a way to clear/reset a non-required dropdown field.
The text was updated successfully, but these errors were encountered: