-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Space trigger dropdown visibility on inputs. Perhaps an option to disable openOnSpace
#3768
Comments
openOnSpace
openOnSpace
@layershifter, you underatand wrong (or i got it wrong). The issue there is about when For example;
Now when I press If I put |
Please provide a minimal repro case, it will be easier to understand the issue. |
Sure. You're right actually. It's on the way. Once finished, gonna publish here |
@layershifter here you go: https://codesandbox.io/s/semantic-ui-react-e0cj6 Try to write words separated by space. Instead of adding space to input, it will either close or open dropdown and no space will be inserted. As I said, I use input as a trigger. You can see that in code. |
Thanks 👍 It's the same bug as in #3764.
However, the fix that was introduced in #3766 will not fix this issue. Okay, the next questions. Why you need to have |
I do not filter things. The Live action: As you can see i can put |
You can do this by And now I see that your issue is closer to #3146. As now we improved focus handling, probably we can try to bind event listeners to the input field instead of |
Well, this is much much cleaner. I will use this way. (Instead of monkey-patching) Thank you!
Will be great in both way. |
Bug Report
Steps
Expected Result
I should be able to use space in input and not trigger menu visibility
At least, we need a prop for this specific usage.
See related issue here: #3146
See related code here:
Semantic-UI-React/src/modules/Dropdown/Dropdown.js
Lines 530 to 535 in 81d3cd1
To fix here, I commented
e.preventDefault();
as// e.preventDefault();
.In fact, i can't even press space when dropdown menu is visible. Needs to be closed first. To be able to fix that, I had to remove spacebar keycode check condition from here:
Semantic-UI-React/src/modules/Dropdown/Dropdown.js
Lines 585 to 587 in 81d3cd1
Also to achieve expected result; I had to set
closeOnChange
tofalse
.For now, I monkey-patched via
patch-package
.Actual Result
dropdown close and open on each spacebar press
Version
0.88.0
The text was updated successfully, but these errors were encountered: