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 string with space causes select the first option #3764

Closed
honzajerabek opened this issue Aug 28, 2019 · 8 comments
Closed
Labels

Comments

@honzajerabek
Copy link
Contributor

honzajerabek commented Aug 28, 2019

Bug Report

Steps

  1. Have a Dropdown (both selection and search true) and options that are multiple words starting same first word
  2. Open the dropdown and start typing the first word, that is common for some number of options
  3. Press space to continue writing
  4. the first available option is immediately selected

note: I've tried number of combinations of selectOnNavigation, selectOnBlur props as well as stopping propagation on onSearchChange and other events

Expected Result

Dropdown lets me to search any string I want

Actual Result

Dropdown cuts typing the search word on the spacebar press and selects the first available option from the search results

Version

0.88.0

Testcase

https://codesandbox.io/s/semantic-ui-react-9undx

@evanstern
Copy link

I'm seeing this as well. This is a problem for me because I'm adding items to the dropdown list and this issue means I can't add items with spaces in them.

@ambroselittle
Copy link

ambroselittle commented Aug 28, 2019

This issue undoubtedly is caused by this: #3702

That PR should be named "force" selection not "allow". :D

Suggestion that if search is enabled, this behavior is not enabled. And/or add an option to configure. But really, it shouldn't happen during search.

@evanstern
Copy link

Yes, at the very least this needs to be an option, not the default.

@ambroselittle
Copy link

By the way, temporary workaround that tested OK for us - downgrade to 0.87.3. Unless you need something in 0.88, of course.

@honzajerabek
Copy link
Contributor Author

honzajerabek commented Aug 29, 2019

Suggestion that if search is enabled, this behavior is not enabled. And/or add an option to configure. But really, it shouldn't happen during search.

@ambroselittle Agree, it does behave like that in non-react semantic-ui - https://jsfiddle.net/Lqanh61p/1/

i guess I'll have some time to make a pr

@evanstern
Copy link

evanstern commented Aug 29, 2019

i guess I'll have some time to make a pr

👍 -- I was about to say the same thing but if you want to do this that's fine with me! (just saw that you already submitted it)

By the way, temporary workaround that tested OK for us - downgrade to 0.87.3. Unless you need something in 0.88, of course.

Yeah, we want the fixes in 0.88 that stop message spam about UNSAFE_ lifecycle methods so I'd rather not downgrade. Luckily, we are at a place in development where we can live with a buggy UI element until it gets fixed.

@layershifter
Copy link
Member

Thanks for reporting and special thanks to @honzajerabek 🍾
Will be released during this week 👍

@layershifter
Copy link
Member

Release in 0.88.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants