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: Controlled Dropdown component ignores spaces #3146

Closed
mic4ael opened this issue Sep 11, 2018 · 9 comments · Fixed by #4041
Closed

Dropdown: Controlled Dropdown component ignores spaces #3146

mic4ael opened this issue Sep 11, 2018 · 9 comments · Fixed by #4041

Comments

@mic4ael
Copy link
Contributor

mic4ael commented Sep 11, 2018

Bug Report

Steps

Create a controlled Dropdown component and by controlled I mean setting the open prop manually.
Then, add a debounced onSearchChange callback. The problem here apparently stems from the fact that I am setting open prop in a debounced function. After first call of this function I am able to properly type words separated by a space.

Expected Result

Changing the search query would properly register each character.

Actual Result

Apparently typing e.g. adam tr ignores the space in between the words.

Version

0.82.4

Testcase

https://codesandbox.io/s/ppxwk52xqx

@mic4ael
Copy link
Contributor Author

mic4ael commented Sep 11, 2018

It is worth to mention that the problem is not visible as soon as I don't specify the open prop manually.

@layershifter
Copy link
Member

Almost sure that issue is comes from there: https://github.com/Semantic-Org/Semantic-UI-React/blob/v0.82.4/src/modules/Dropdown/Dropdown.js#L552

However, I doesn't have a good how to fix this.

@mic4ael
Copy link
Contributor Author

mic4ael commented Sep 14, 2018

Why does it even behave like this? Why should the dropdown show the options after typing a space? I can't come up with a good usecase for a situation where I would like the dropdown to be open on pressing space.

@stale
Copy link

stale bot commented Mar 13, 2019

There has been no activity in this thread for 180 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one.

However, PRs for this issue will of course be accepted and welcome!

If there is no more activity in the next 180 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks!

@stale
Copy link

stale bot commented Sep 9, 2019

This issue will be closed due to lack of activity for 12 months. If you’d like this to be reopened, just leave a comment; we do monitor them!

@stale stale bot closed this as completed Sep 9, 2019
@layershifter layershifter reopened this Sep 9, 2019
@stale stale bot removed the stale label Sep 9, 2019
@xReaven
Copy link

xReaven commented Oct 17, 2019

I don't know if it's really related to this issue, but i'm facing a similar problem with minCharacters ;
I am unable to input a space right after an other character, while I didn't write at least the value of minCharacters.

Here's an example : https://codesandbox.io/s/upbeat-franklin-ovolw?fontsize=14

Try to press "a" then "space" (quickly or not, it seems that it doesn't matter). You simply can't. It opens the dropdown.

Otherwise if you press "a" then "space" then "space", it works, because the dropdown is already open. The next space (the third) will not work, because it opens... etc etc

@pavle-lekic-htec
Copy link

I have the same problem, if I enter "wqe" then it stops responding to space, but if I erase all text and try again then space works. Weird.

@layershifter
Copy link
Member

I simplified the test case, https://codesandbox.io/s/semantic-ui-react-tm7q5
Bug is still present in v1.0.0.

@layershifter
Copy link
Member

A fix was released in [email protected] 🎉

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

Successfully merging a pull request may close this issue.

4 participants