html icon indicating copy to clipboard operation
html copied to clipboard

Should keyup be an activation triggering input event?

Open zcorpan opened this issue 1 year ago • 1 comments

What is the issue with the HTML Standard?

See https://software.hixie.ch/utilities/js/live-dom-viewer/saved/12660

keydown is an activation triggering input event, but keyup is not. For the Enter key, the activation happens on keydown, but when pressing Space on a button, the activation happens on keyup.

Per spec and in Firefox, if you turn off repeating keys in the OS and hold space for 5 seconds or more, the popup is blocked. In Safari and Chrome the popup is not blocked.

This might not be an issue in general since users don't typically hold keys for so long, but the website might be busy running scripts and the user might be on a slow device (and maybe running a screen reader which can make things slower still), so it's still plausible that some users get blocked popups (or denied other activation-gated features).

What happens in WebKit and Chromium?

Giving websites two activations for one keypress seems bad, though, but maybe there's a way to extend the activation timer if it wasn't consumed since keydown or so.

cc @CanadaHonk

zcorpan avatar Apr 26 '24 16:04 zcorpan

cc @mustaqahmed

zcorpan avatar Jun 03 '24 15:06 zcorpan