-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selection in form control elements, user-select, and customizable select #10876
Comments
This is #8228 |
Thanks mason! From that issue:
Based on this, I think we should just add user-select:none to base appearance |
4 tasks
aarongable
pushed a commit
to chromium/chromium
that referenced
this issue
Jan 6, 2025
Mouse-based text selection doesn't work in customizable select. Based on this issue, we should at least set user-select:none in the UA stylesheet: whatwg/html#10876 Bug: 385069402 Change-Id: I87cbfde4cfde67c7b1fe131a6070311034143bd1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6111420 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1402577}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
<input type=text>
: In chrome+firefox+safari, UA stylesheet has user-select:auto. Setting user-select:none does not prevent selection of text.<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.<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.
The text was updated successfully, but these errors were encountered: