DEV Community

loading...

Discussion on: I put 18 event handlers on a React element

Collapse
ma5ly profile image
Thomas Pikauli Author

I think the difference has to do with keyPress only registering actual characters like letters and numbers, while keyDown registers any key.

Collapse
qm3ster profile image
Mihail Malo

I feel like in both cases keyDown should fire once per physical press and then wait for keyUp before being able to fire again for this keycode. In nether case did it do that.

keyPress on the other hand can do whatever it damn pleases, including reacting only to characters appearing, I don't care :v