-
-
Notifications
You must be signed in to change notification settings - Fork 331
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] Clearable remove icon visible by default #839
Comments
@TivoSoho I nearly spent the whole weekend for this 👀 . The conclusion is, that the current behavior is correct. Let me explain:
When using A combination of having both, an empty option value being selectable and making it clearable, simply does not work together logical wise. And after the weekend debugging nearly the whole dropdown component, i am convinced this logic is correct. When you need to
-> remove the empty or
-> use an empty option with a text representing your desired placeholder as a first option Your adjusted fiddle as follows https://jsfiddle.net/w4vgxfn5/ |
I disagree. For us clearable icon is an extra to quick clear - we do not want to replace choosing empty. Having 2 methods to clear a value is not illogical by any means. For us clearable broke when moving from Semantic UI to Fomantic. This is a sample with Semantic UI working beautifully in all cases: https://jsfiddle.net/vL8da4y2/ And finally, to quote your own text - "By design a tag (standard HTML) always has one value selected (either the first one or the one defined by attribute selected). To somehow avoid this, one (usually the first) option has to be an empty option (value="")". So by design the empty option is meant to be a "nothing selected", which Fomantic fails to identify. And while I do not have any idea in what case where you need to really unselect an "empty" option that could be an extra feature, a strict mode, but not default. |
And to add one point that is important to me and our site - if you were to remove Fomantic UI (and it's weird definition of clearable) you are losing/breaking functionality. You would have to go through each select to make sure it has the empty option. |
Thanks for the jsfiddle...i am digging into the SUI code again. It is correct, FUI currently fails to identify because of the "" value in both cases.... i'll investigate again..if SUI can do it, FUI will do it as well 😄 |
Fixed by #889 @TivoSoho Please accept my apologize for arguing into the wrong direction! The behavior is now identical to SUI again 😃 |
@lubber-de You're my superhero now for fixing this! Many thanks!! |
Steps to reproduce
Expected result
No selection = no remove icon
Actual result
Shows remove icon even when nothing selected. Once you either click it or choose the empty option it goes away and does not reappear. It is not adding the noselection class to select on init.
Testcase
https://jsfiddle.net/pn12f3Lr/2/
Version
2.7.6
The text was updated successfully, but these errors were encountered: