fix(editor): allow text selection and input in editable elements (#1209)

The workbench sets user-select: none on body and nothing restored it for editable elements, so a contenteditable such as CodeMirror's .cm-content inherited it. In WebKit a contenteditable with user-select: none cannot hold a selection, so typing, paste and drag-and-drop into the editor could be dropped. input, textarea and [contenteditable="true"] now get user-select: text next to the cursor: text rule they share; the selection lock still overrides it.

Co-authored-by: nguyenmuoi157 <33494100+nguyenmuoi157@users.noreply.github.com>
This commit is contained in:
nguyenmuoi157
2026-11-04 23:10:08 +08:00
committed by GitHub
parent 59f1a1e6db
commit f942ea168d
+2
View File
@@ -41,6 +41,8 @@ html[data-selection-lock] *:not([data-selection-scope], [data-selection-scope] *
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]),
textarea,
[contenteditable="true"] {
-webkit-user-select: text;
user-select: text;
cursor: text;
}