Buttons inside the Selection should not highlight its text/content
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
People
(Reporter: rcaliman, Unassigned)
References
Details
Attachments
(3 files)
Button elements are not user-selectable by default.
But when using the programmatic approach with Selection.selectAllChildren()
, button elements do get a selection highlight even when explicitly asked to be ignored with CSS -moz-user-select: none
.
Google Chrome seems to respect this and does not highlight button elements as selected. This is likely a Gecko implementation issue.
See attached HTML file with test case.
Reporter | ||
Comment 1•5 years ago
|
||
A video demo using the attached test case file showing that Google Chrome ignores both manual and programmatic user selection of button elements.
Additionally, Chrome prevents selection on all elements with CSS user-select: none
. Firefox still shows the selection highlight (though it does not copy the highlighted content to the clipboard, as expected).
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
The -moz-user-select
property controls only what content the user can select.
It doesn't restrict what script can do, so there's no Selection bug here.
Whether or not the button text should be highlighted when it's inside
the Selection is a different matter.
Comment 3•5 years ago
|
||
The component has been changed since the priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Comment 4•4 years ago
|
||
It's not clear to me this is a bug at all. FWIW, both Chrome and Safari also highlight the button's text content when it is selected. Mats, should we close this as invalid, or do you think the behavior should be changed?
Comment 5•4 years ago
|
||
If you click "Select all" and then copy-paste the text then "Button" is excluded even though it's highlighted as selected. That seems confusing. "Button" should either be included in the copied text, or not be highlighted in the first place. I think I'd prefer the latter. We might want to keep the current behavior if it's contenteditable
though. In that case, I can currently select/edit the button text, which seems like a feature worth keeping.
Comment 6•4 years ago
|
||
Chrome highlights "Button" and includes it in the copied text (in my test in comment 5) so that's argument for doing the former I guess.
Updated•2 years ago
|
Description
•