Skip to content
Advertisement

Tag: keyboard-events

onKeyDown / onKeyUp listener in React

I am trying to add an event listener to an icon in React and it’s not working. My code: I also have an onClick handler on the same button that functions just fine, so I’m really confused as to why the onKeyDown doesn’t fire. Appreciate any help anyone can provide! Answer Using onKeyDown on a certain element will require focus

Advertisement