Skip to content

shortcuts without modifier keys prevent writing that key in inputs #29

@nfcampos

Description

@nfcampos
<DockMonitor toggleVisibilityKey='s'>
  <LogMonitor/>
</DockMonitor>

Hi,

setting a shortcut like that (without a modifier key) prevents me from typing that letter in inputs (because handleKeyDown() calls event.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 body

another 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 😃 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions