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

[keyboard] provide option to ignore shortcuts in input elements #475

Open
AerisG222 opened this issue Jul 19, 2023 · 0 comments
Open

[keyboard] provide option to ignore shortcuts in input elements #475

AerisG222 opened this issue Jul 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@AerisG222
Copy link

Describe The Problem To Be Solved

There should be a way to ignore / opt out of shortcuts while typing in an input / select / textarea element.

For the scenario below, let's assume we have a button with a shortcut of 'S' and a textarea on the same page.

With the current default (preventDefault = true), when the letter is pressed while the textarea has focus, the shortcut gets triggered and the letter does not get added to the value of the input element. This is a problem as we should be able to type 'S' in the input.

If we then configure preventDefault = false - we get the desired behavior of the letter being added to the input, however the shortcut is also triggered, which may be undesirable.

Suggest A Solution

To address the issue with minimal impact to existing users, adding a new boolean option called something like 'ignoreInInputs' could be used to alter behavior in the shortcut logic. By default, this can be set to false to keep same behavior as today.

Finally, the documentation should be updated to describe these scenarios and add examples to make this as easy to use as possible.

Thanks for your consideration!

@thetarnav thetarnav added the enhancement New feature or request label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants