Closed soheil-zz closed 7 years ago
In this case your keyEventName
needs to be KEYDOWN
or KEYUP
not KEYPRESS
.
PS I recommend not using key codes but key values like this:
<KeyHandler keyValue="Escape" onKeyHandle={() => this.dismissOverlay()} />
Note to self: it's important to write documentation for this behaviour https://github.com/ayrton/react-key-handler#key-event-names
http://stackoverflow.com/questions/3396754/onkeypress-vs-onkeyup-and-onkeydown
That's what I have and it doesn't work. If I put 13 it'll work fine with Enter.