DEV Community


Discussion on: Snippet: Making your buttons fully accessible

anevins12 profile image
Andrew Nevins

Thanks for writing this. I was wondering if you should be using keyup instead so that the event does not trigger on a down event and I think keypress is deprecated.

Guidance on not triggering down-events from sc. 2.5.2 Pointer Cancellation:

Guidance on keypress event from MDN:

mizziness profile image
Tammy Shipps Author

Oh right, I'd forgotten about that! Thank you! I checked the Mozilla docs and they suggest keydown, so I'll give that a shot. Editing my code accordingly. <3