Semantic-ui: [Dropdown] - Search dropdown enter and blur couses first option selection

Created on 30 Aug 2016  路  18Comments  路  Source: Semantic-Org/Semantic-UI

Steps to Reproduce
Enter and blur search selection dropdown with yet selected item.

  1. Select some "not first" item in the search dropdown.
  2. Again click into dropdown (in the search input, not only the arrow).
  3. Click anywhere else outside the dropdown (blur the dropdown).

Expected
The dropdown should keep previesly selected item.

Result
The dropdown selects the first item in the list.

Testcase
http://jsfiddle.net/ba7dkjx4/

WORKAROUND
forceSelection: false //but on search dropdown it should be default false

Discussion Enhancement

Most helpful comment

This Issue should be included into the next Release.

All 18 comments

I can confirm this bug

The jsfiddle testcase is empty. I created one example here:
http://jsfiddle.net/0hfpccjz/

forceSelection: false is not an easy workaround for me because this allows to set a string which is not in the dropdown.

Edit: it's also an issue on multiselect dropdowns as shown here
multiselect

Confirmed!

I've gotten this as well

Setting forceSelection to false solved the problem for me.

Also happening to me in Search Dropdown. Can be reproduced using the documentation by selecting any country and if we open the dropdown again and 'blur' it it will always select the first option "Afghanistan"

**
image
**

This Issue should be included into the next Release.

We got the same issue in here.

Try disabling selectOnKeydown by using selectOnKeydown: false, this is a separate behavior than whether it forces selection on blur.

http://jsfiddle.net/wu3r699v/

I kind of regret the naming choices, as forceSelection should have been something like selectOn: ['keydown, 'blur'] merging the two rules together and making it more clear what they actually affect.

I might actually refactor it this way while deprecating the previous settings for it to make more sense.

In previous releases it was possible to type a few characters into the dropdown search and confirm the first selected item with tab. What do i have to do to make this work again?

@juice forceSelection: false

@jlukic Hi Jack, thanks for the tip, but this works only 50 percent of the time. I love this project, but right now the Dropdown part is a problem for many week. We use Dropdowns on a page with many Form Fields, most of them are generated from select fields and some of them are remote searches.

People want to type a few characters and tab to the next dropdown or text field. Right now, i have to choose between, dropdowns clear the current selection/add the first item to a multiselect or tab select is only working for some dropdowns if "forceSelection: false" is set, plus the typed characters are rendered over the selected text.

i feel like, as a default dropdowns should behave like native select fields. if you click on a dropdown, the current selection should not be cleared, the grey highlight should sit on the last selected item. i hope you can follow me. The Dropdowns worked as aspected pre 2.2.x and now it is a step by step process to see that with every release something gets fixed and something else stops working. I hope you can bring back the dropdown magic.

function firstUnfiltered
partial workaround: showOnFocus: false but after key down is selected first again

@jlukic I did a little research and I see it's only for 'search multiple selection dropdown' and not for 'multiple selection dropdown', so it seems to be the combination of 'search' and 'multiple' where 'forceSelection: false' fails.

I hope that helps.

Hi @ajarti, I can鈥檛 seem to reproduce, can you please fork this JSFiddle to create a test case?

Can anyone provide a JSfiddle showing this issue in the current version?

I'm testing in latest with multiple search selection dropdown and am not seeing it selecting incorrect value. Perhaps I'm not reproing correctly?

Oh hey.. this appears to be fixed in next release, but not current release.

Apparently I noticed this on my own and fixed without linking back to this issue
https://github.com/Semantic-Org/Semantic-UI/commit/238ac3c8906330e0fcc1980fefeea0ae2dfb2bda

This will go out with 2.2.11 on tuesday.

And yes.. previous behavior was very annoying and incorrect, apologies.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

batata004 picture batata004  路  3Comments

playgithub picture playgithub  路  3Comments

ghost picture ghost  路  3Comments

davialexandre picture davialexandre  路  3Comments

deneuxa picture deneuxa  路  3Comments