Skip to content

Commit d2a308d

Browse files
committed
Merge branch '4.x' into 5.x
* 4.x: Fix the disabling of text editor fields
2 parents 36c5f28 + 080ae90 commit d2a308d

5 files changed

Lines changed: 16 additions & 4 deletions

File tree

assets/css/form-type-text-editor.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ trix-editor {
6464
padding: 3px;
6565
}
6666

67+
/* Trix natively disables typing when [disabled] is set on <trix-editor>
68+
(it sets contenteditable="false"), but the toolbar buttons stay clickable
69+
and the field still looks editable. Grey out the whole wrapper and block
70+
pointer events so a disabled TextEditorField looks and behaves disabled. */
71+
textarea.ea-text-editor-content[disabled] + .ea-text-editor-wrapper {
72+
background-color: var(--form-control-disabled-bg);
73+
cursor: not-allowed;
74+
opacity: 0.65;
75+
pointer-events: none;
76+
user-select: none;
77+
}
78+
6779
trix-toolbar .trix-dialog {
6880
background: var(--form-type-text-editor-dialog-bg);
6981
box-shadow: var(--form-type-text-editor-dialog-box-shadow);

public/entrypoints.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
},
6464
"field-text-editor": {
6565
"css": [
66-
"/field-text-editor.d426785c.css"
66+
"/field-text-editor.54df6d1e.css"
6767
],
6868
"js": [
6969
"/field-text-editor.8797161e.js"

0 commit comments

Comments
 (0)