-
Notifications
You must be signed in to change notification settings - Fork 47
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
shortcuts without modifier keys prevent writing that key in inputs #29
Comments
Thanks for kind words. |
that was just because this app i'm working on has other shortcuts like that (without modifier key) and it was just to be consistent. (the shortcut library https://craig.is/killing/mice i use for the other shortcuts does this thing of not triggering them when focused on an input) |
I'm happy to add a check like this. Want to send a PR? |
done :) |
Fixed by #30. |
Hi,
setting a shortcut like that (without a modifier key) prevents me from typing that letter in inputs (because
handleKeyDown()
callsevent.preventDefault()
)one solution for this would be to add this line
if (e.target !== document.body) return
to
handleKeyDown()
because if an input is focused the target of the keydown event is that input, if no input is focused the target of the event is the bodyanother solution would be to
return
if the tag name of the target of the event is input, textarea, etc.would you be open to doing one of these things, or some other way of not triggering the shortcuts while an input is focused?
Thanks,
Nuno
(also, thanks a lot for all you've done with redux,etc it plays a big part in how i write apps now 😃 )
The text was updated successfully, but these errors were encountered: