Do not use "onkeydown" or "onmousedown" for links and buttons

For: Development

Pointer Cancellation (2.5.2 level A)

https://www.w3.org/WAI/WCAG21/Understanding/pointer-cancellation

  • For interactive elements, only trigger actions once the user takes their finger or pointer away from the activation target.
  • Avoid triggering functionality on down-events, such as onmousedown. Use events such as onclick instead.
  • If a function is triggered on an up-event (for example onmouseup), provide a way to abort or undo the function.