Semantic-ui-react: Dropdown: search string with space causes select the first option

Created on 28 Aug 2019  路  8Comments  路  Source: Semantic-Org/Semantic-UI-React

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

bug

Most helpful comment

Thanks for reporting and special thanks to @honzajerabek 馃嵕
Will be released during this week 馃憤

All 8 comments

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.

This issue undoubtedly is caused by this: https://github.com/Semantic-Org/Semantic-UI-React/pull/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.

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

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

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

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.

Thanks for reporting and special thanks to @honzajerabek 馃嵕
Will be released during this week 馃憤

Release in 0.88.1 馃殌

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattmacpherson picture mattmacpherson  路  3Comments

levithomason picture levithomason  路  3Comments

hankthewhale picture hankthewhale  路  3Comments

laukaichung picture laukaichung  路  3Comments

AlvMF1 picture AlvMF1  路  3Comments