w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
144 stars 51 forks source link

Remove dblclick text selection default action to match browsers #328

Closed flackr closed 1 year ago

flackr commented 2 years ago

The spec currently states that the default action for dblclick has the following additional behavior:

If the event target is selectable, the default action MUST be to select part or all of the selectable content. Subsequent clicks MAY select additional selectable portions of that content.

However, Chrome, Firefox and Safari all begin text selection with varying degrees of granularity (i.e. word, sentence / paragraph) on the mousedown event (in contrast to dblclick which is after the mouseup), allowing the user to drag the mouse to easily select more than one word / sentence / paragraph. This is consistent with selection in other OS applications, and is also more consistent with the character text selection which begins on mousedown which is part of the note for mousedown. This has lead to some confusion about not being able to cancel the text selection on the dblclick event.

TLDR; I think we should remove the dblclick text selection action. We could add it to the note for mousedown, though given it already mentions starting text selection we may not need to add anything.