Skip to content
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] - Search dropdown enter and blur couses first option selection #4506

Closed
michtill opened this issue Aug 30, 2016 · 18 comments
Closed

Comments

@michtill
Copy link

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

@michtill michtill changed the title [Dropdown] - Your Bug Name [Dropdown] - Search dropdown enter and blur couses first option selection Aug 30, 2016
@elquimista
Copy link

I can confirm this bug

@gizzard
Copy link

gizzard commented Aug 31, 2016

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

@brunotourinho
Copy link

Confirmed!

@khornberg
Copy link

I've gotten this as well

@khornberg
Copy link

Setting forceSelection to false solved the problem for me.

@PauloGraca
Copy link

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
**

@juice
Copy link

juice commented Sep 19, 2016

This Issue should be included into the next Release.

@MaikeMota
Copy link

We got the same issue in here.

@jlukic
Copy link
Member

jlukic commented Oct 7, 2016

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.

@juice
Copy link

juice commented Oct 7, 2016

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?

cbxp added a commit to cbxp/Semantic-UI that referenced this issue Oct 17, 2016
…ement is unfiltered

firstUnfiltered() forced change of selection even if previously selected element was visible. This meant that when tabbing through the field, the selected option was changed to first visible.
@jlukic
Copy link
Member

jlukic commented Oct 19, 2016

@juice forceSelection: false

@juice
Copy link

juice commented Oct 31, 2016

@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.

@jobes
Copy link

jobes commented Nov 2, 2016

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

@ajarti
Copy link

ajarti commented Apr 13, 2017

@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.

@awgv
Copy link
Member

awgv commented Apr 13, 2017

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

@lauri-elevant
Copy link
Contributor

@juice Thanks, the commit you linked looks good:
cbxp@3fe5c55

@jlukic
Copy link
Member

jlukic commented Jul 3, 2017

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?

@jlukic
Copy link
Member

jlukic commented Jul 3, 2017

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
238ac3c

This will go out with 2.2.11 on tuesday.

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

@jlukic jlukic added this to the 2.2.11 milestone Jul 3, 2017
@jlukic jlukic closed this as completed Jul 3, 2017
jlukic added a commit that referenced this issue Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests