Title:
Intent to Implement And Ship: <Enter on element with tab index should generate click event>
Body:
Contact emails
Spec
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute https://html.spec.whatwg.org/multipage/interaction.html#activation-behaviour
Summary
As per the spec, the elements having tab index attribute
are focusable and if it does not otherwise have an activation behavior defined
has an activation behavior that does nothing. This
means that an element that is only focusable because of its tabindex
attribute will fire a click
event in response to a non-mouse activation
(e.g. hitting the "enter" key while the element is focused).
Motivation
If an element has tab index, it can be activated through mouse click or keyboard Enter key. As of now to trigger activation behavior from both inputs, developer will have to add keypress and click listeners. If we make the change as per spec,
click listener would suffice for both inputs (Mouse & Keyboard).
Compatibility Risk
As of now it is not supported in any of the major browsers like IE, Firefox, Chrome etc
Ongoing technical constraints
None
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
OWP launch tracking bug?
https://code.google.com/p/chromium/issues/detail?id=122652
Requesting approval to ship?
Yes
Regards,
Ramya
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Can you ask around whether the rest of the vendors are also going to implement this?This means that "keypress" as well as "click" events will be triggered which might duplicate the outcome, which is pretty risky and confusing, especially if Chrome is the only one to behave this way.
FWIW it is what Presto does when using spatial navigation (arrow keys on a remote control for instance, or shift-arrow in the desktop versions of Presto Opera). I can't recall seeing any specific bug reports related to that. The tricky part was focus/blur events in the pseudo-focus that we used, but sending click events seemed to be fine.
It is of course possible to create a site that will misbehave, but the alternative is typically that the site won't work at all since the page authors didn't have time/imagination enough to consider users with only a keyboard.
If a cancel (preventDefault) on the keydown event stops the click event from firing, then the compatibility issues would be reduced because good keyboard handlers should cancel events that they have processed in this way.
FWIW it is what Presto does when using spatial navigation (arrow keys on a remote control for instance, or shift-arrow in the desktop versions of Presto Opera). I can't recall seeing any specific bug reports related to that. The tricky part was focus/blur events in the pseudo-focus that we used, but sending click events seemed to be fine.'shift-arrow' & 'remote arrow-keys' are not a common input mode for the web. What concerns me is that 'enter' is a common input mode and handled by a lot of existing web-apps. (I know for certain that large web-apps listen for both click & enter-keypress).
It is of course possible to create a site that will misbehave, but the alternative is typically that the site won't work at all since the page authors didn't have time/imagination enough to consider users with only a keyboard.The point isn't that it is possible to create a site that will misbehave. It's that there are potentially a lot of sites already created which will misbehave, potentially having serious compat issues.I would be fine with this if there is proof that this wouldn't create compat issues.
That is pretty much unprovable. On the other hand, what about those sites that keyboard users can't access today? It's always a balance.
(we do have a non-trivial number of dev-channel users that run with --enable-experimental-web-platform-features)
On Wed, 20 May 2015 19:54:05 +0200, Mike Lawther <mikel...@chromium.org> wrote:On 20 May 2015 at 10:16, Daniel Bratell <bra...@opera.com> wrote:On Wed, 20 May 2015 16:46:26 +0200, Ian Kilpatrick <ikilp...@google.com> wrote:The point isn't that it is possible to create a site that will misbehave. It's that there are potentially a lot of sites already created which will misbehave, potentially having serious compat issues.I would be fine with this if there is proof that this wouldn't create compat issues.That is pretty much unprovable. On the other hand, what about those sites that keyboard users can't access today? It's always a balance.Yep, it's a balance. Let me rephrase - how confident are we that this will not cause differences in behaviour between Chrome and all other current browsers that will make users and developers cry 'this is broken!'. How confident are we that this number is small relative to the number of sites that keyboard users can't access today, and will be able to after this change?I can only offer anecdotal evidence here but my experience from embedded Presto where a mouse like input device was missing, is that explicit keyboard support is rare, even from major sites[1]. If the site was simple enough to only use <a> and <button> it would work, but as soon as they had other elements that were possible to interact with like <div onclick> only (back then) non-standardized methods saved the users.On the other hand, the suggestion here is that activation with enter should work for custom elements with the tabIndex attribute. If they have that attribute then the author has apparently already thought at least a little about keyboard navigation so we are not talking about the typical page.