Given <label>Lorem ispum<input></label> if you click and hold the text, move the pointer around then back to the text and release the button, the way the click event is forwarded to the <input> is not consistent across UAs.
In Safari, the click is always forwarded
In Chrome, the click is forwarded if no selection was created when moving the mouse around (mouseup must fire on the same half-character mousedown did).
In firefox, no click is forwarded if you move the pointer at all.
When user-select: none(resp. -webkit-user-select) is set via CSS, the behavior is sometimes different.
Safari and Chrome always forward the click (that is also the native macOS behavior)
Firefox the click is forwarded if you release the mouse on the same half-character as you started and if you don't leave the label while moving the pointer.
The last bullet point is a Firefox bug per the current spec which mandates host-like behavior.
I'm not sure about the native macOS behavior when the text of a label can be selected.
I think browsers should behave consistently here (either with the platform, or with each-others (#4516)), but I'm not sure which behavior is preferable.
This is an accessibility issue for users with fine motor control disorders. Input from the WCAG would IMO be important, but I don't know who to tag.
What is the issue with the HTML Standard?
Given
<label>Lorem ispum<input></label>
if you click and hold the text, move the pointer around then back to the text and release the button, the way theclick
event is forwarded to the<input>
is not consistent across UAs.mouseup
must fire on the same half-charactermousedown
did).When
user-select: none
(resp.-webkit-user-select
) is set via CSS, the behavior is sometimes different.The last bullet point is a Firefox bug per the current spec which mandates host-like behavior.
I'm not sure about the native macOS behavior when the text of a label can be selected.
I think browsers should behave consistently here (either with the platform, or with each-others (#4516)), but I'm not sure which behavior is preferable.
This is an accessibility issue for users with fine motor control disorders. Input from the WCAG would IMO be important, but I don't know who to tag.
You can find a repro here.
Edit: fixed the exact Firefox behavior