contenteditable still selects non-contenteditable even with user-select: none
Categories
(Core :: DOM: Selection, defect)
Tracking
()
People
(Reporter: konnor5456, Unassigned)
References
(Depends on 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0
Steps to reproduce:
Create a contenteditable element, add a non-contenteditable inside of it, remove user-selections via CSS, focus the contenteditable, hit "CMD+A" to select all contents.
Actual results:
It selected the non-contenteditable contents.
Expected results:
It should not have selected the non-contenteditable contents.
Codepen of the issue:
https://codepen.io/paramagicdev/pen/rNXpJYm
This works as expected in Chrome 130 and Safari 17.6
![]() |
||
Updated•4 months ago
|
Comment 1•4 months ago
|
||
Hello, thank you for the bug report!
Managed to reproduce this issue on:
- Firefox Nightly 133.0a1;
- Firefox 132.0;
Tested and reproduced on:
- macOS 14;
- Ubuntu 22;
- Windows 10;
Setting as NEW so the developing team can have a look.
Comment 2•4 months ago
|
||
Well, if it's in non-editable element, it works as expected.
https://jsfiddle.net/d_toybox/tozaqfbj/
I found the different paths for editable vs. non-editable cases.
https://searchfox.org/mozilla-central/rev/73adec8ae1089db082e350da8951b8dde7aa3bcb/dom/base/Selection.cpp#1047-1054
So, I think that this is a long standing issue depending on bug 1773065.
Reporter | ||
Comment 3•4 months ago
|
||
I forgot to add, I sent this to a friend and they reported Firefox on Android has the same behavior as desktop where it will select non-editable / non-selectable elements if you hit "Select All"
Description
•