0

So I have a React app where I'm trying to improve keyboard accessibility. According to https://webaim.org/techniques/keyboard/, the 'enter' and the spacebar key should "click" on focused buttons. I can see from the UI that the buttons are coming into focus, but enter/spacebar only works on some of them.

Is there an explanation for this, or a fix?

arc_0412
  • 11
  • 1
  • Odds are there is a `preventDefault()` (or React equivalent) intercepting the clicks and stopping them working. Unfortunately without anything to test against the best we can say is to check out the event handlers attached to the buttons that don't work and see if they are intercepting clicks (or bound to `mouseDown` etc.). Also check that they are actually ` – GrahamTheDev Apr 17 '21 at 06:08
  • Definitely need to see your code, but a potential answer here using the "submit" button type you get access to the enter key method: https://stackoverflow.com/questions/33211672/how-to-submit-a-form-using-enter-key-in-react-js – Nathaniel Flick Apr 18 '21 at 22:40

0 Answers0