KEMBAR78
Selection in form control elements, user-select, and customizable select · Issue #10876 · whatwg/html · GitHub
Skip to content

Selection in form control elements, user-select, and customizable select #10876

@josepharhar

Description

@josepharhar

What is the issue with the HTML Standard?

Here's a codepen that shows some examples: https://codepen.io/jarhar/pen/LEPWaLo

Some interesting behavior I noticed:

  1. <input type=text>: In chrome+firefox+safari, UA stylesheet has user-select:auto. Setting user-select:none does not prevent selection of text.
  2. <button>: In chrome+safari, buttons have user-select:auto in the UA stylesheet and text selection does not work when using the mouse but does when using the keyboard (select all). In firefox, buttons have user-select:none in the UA stylesheet and text selection does work if you change it to user-select:auto.
  3. <select>: In chrome+safari, UA stylesheet has user-select:auto, firefox has user-select:none. Selection does not work in chrome+safari when using the mouse, but does when using the keyboard (select all). If you set user-select:auto in firefox, then selection sort of works with the mouse but is hard to trigger due to the popup.

My takeaway from this is that chrome and safari have some code to prevent text selection with the mouse on these form control elements regardless of user-select, and firefox does not. I think there was another issue filed about this somewhere for <button>.

For customizable select, I want to make sure that selection isn't broken inside the picker unless we decide that it really should be. I'm still looking at the behavior there, but I think that adopting behavior more like firefox for customizable select will probably make this better since we can actually control it with css.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions