Dropdown: Search selection dropdown takes value of first option when user did not make a selection #663
-
Bug ReportA search selection dropdown will take the value of the first option even though a user did not select an item from the dropdown list. This seems to be the same as an old Semantic UI bug: Semantic-Org/Semantic-UI#4506 Steps to reproduce
Expected resultDropdown should have no value/display placeholder ("Select Country") Actual resultDropdown takes the value of the first option (in the example, this is Afghanistan) Version2.7.4 |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
What about the mentioned workaround by using |
Beta Was this translation helpful? Give feedback.
-
@mikescott Is this still an issue or can we close this now? |
Beta Was this translation helpful? Give feedback.
-
It's a bug. In my case I don't have any "empty" option (there is always a value set loaded from DataBase), but the error is nearly the same: when I start to write the list, it filters the options (the expected behaviour), but when I click on the desired option, the previous value is set again. On the DOM the input remains the old value, and the selected class is still on the old value. However, if I search on the whole options list the option (without filtering by writing on the input) and click, the value is updated and succesfully selected. Thanks a lot! PS: I'm on v2.7.5 |
Beta Was this translation helpful? Give feedback.
-
This actually can be a very nasty one if theres an onChange event which submits the form. Even though user just clicks the dropdown arrow and focuses elsewhere then, the form is submitted. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
-
@hamedwiz Did you try the workaround |
Beta Was this translation helpful? Give feedback.
-
yes that didn't work |
Beta Was this translation helpful? Give feedback.
-
@hamedwiz 🤔 Could you please adjust the jsfiddle where |
Beta Was this translation helpful? Give feedback.
-
I was using it like this |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell forceSelection doesn't help, however adding value="" to the option helps. Probably there should be a better solution to this. |
Beta Was this translation helpful? Give feedback.
@hamedwiz 🤔
See difference here : http://jsfiddle.net/rgmn87ab/
The right dropdown using
forceSelection: false
works .Could you please adjust the jsfiddle where
forceSelection: false
does not work for you ?