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
Can not type "S" in Menu Textfield #19116
Comments
Typing S does not work specifically when it is the first letter typed on focus. It works after typing another letter first however. |
Is there any way to overcome this problem? |
Looks like putting a Textfield component inside of a Menu component causes the problem because, if you notice, the "S" you are typing is found in the Textfield Label attribute. If you change/remove the Label, you'll find that it doesn't catch on "S" anymore. This seems to be happening because MUI Menu moves the focus based on what it finds in the MenuList. For some reason, it's also targeting the Label, which it shouldn't, IMO. Do you have to have a Textfield within the Menu? |
Ah, I see. MUI Menu traverses the MenuList items and focuses on every child item. When it focuses on your Textfield child, it sees the text inside of it in the Label ("Standard") and processes it just as if it was an expected MenuList item. |
Seeing if a fix can be merged. |
You can prevent keyboard events from bubbling up from the input to the menu. |
Duplicate of #19096 |
Sol.1: Removing the label it worked.
Thank you soo much! You saved my day! |
Thank you from 2022 for my saved days! |
One more thank you from 2022! |
thankyou from 2023 |
onKeyDown = {(e: KeyboardEvent) => { |
Thank you from 2023! Saved my day! |
Thank you from 2023! Our team was so confused. Saved us. |
I'm not sure why it wasn't obvious to me at first, but 'onKeyDown' is a prop for inputBase. <InputBase Thanks for the help from 2023!! |
Thanks from 2024 |
Thanks from March 2024! |
Thanks from April 2024! 👍🏻 |
Thanks from April 2024! |
I was trying to add textfield in menu, and it works fine.
But when I type S as the first keyword, it doesn't take that key as input, instead it just highlights the menu area.
If S is a shortcut key, then how to disable it for that menu instance?
Can someone help here for this problem.
The code snippet is here:
https://codesandbox.io/s/zealous-feather-ehvec
Just try typing start with S key.
The text was updated successfully, but these errors were encountered: