DEV Community

loading...

Discussion on: Snippet: Making your buttons fully accessible

Collapse
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: w3.org/TR/WCAG21/#pointer-cancella...

Guidance on keypress event from MDN: developer.mozilla.org/en-US/docs/W...

Collapse
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