Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
ckeditor5.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Jan 2022 at 15:44 UTC
Updated:
17 Feb 2022 at 07:54 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
hooroomooComment #3
hooroomooComment #4
hooroomooComment #5
andregp commentedI'll see what I can do on this issue.
Just one question @hooroomoo, I see there is a "Body field is required" inside of the body field on the second picture. Is it present on the first image too?
Because, if only the second example has this it may have been added in purpose to replace the red border as a style choice.
Comment #6
andregp commentedUpdate (about comment #5), I tested on my site and there isn't any "Body field is required" message inside the field, so a red border is indeed missing.
Bellow I have a comparison between CKEditor 5, CKEditor, and no editor, respectivelly.
I'll keep working on a patch
Comment #7
andregp commentedComment #8
andregp commentedApparently the theming/styling of ckeditor is supported by seven theme, (it has its own files for it, like core/themes/seven/css/theme/ckeditor-dialog.css core/themes/seven/js/classy/media_embed_ckeditor.theme.es6.js and even some elements inside core/themes/seven/css/components/form.css use the .cke class), but seven doesn't integrate the ckeditor5.
All styling from ckeditor5 is inside its own module and its elements apparently are all created through .js files with no use of twig. The .js files are gigantic and I don't know how to configure them so I'm unassigning myself from this issue.
Comment #9
andregp commentedComment #10
wim leersGreat find,
@andregp(oops!) @hooroomoo! 👏Comment #12
hooroomooComment #13
wim leersWorks beautifully! But I think that we at minimum need to change the selector from

.ckto.ck-editor, because the.ckclass appears on pretty much every CKEditor 5-owned DOM element:And maybe we should use
.ck-editor > .ck-editor__main, because that will then not include the toolbar in what gets a visual indicator?Comment #14
wim leersComment #15
rkollerI basically agree with comment #13. Even though It might look visually a bit off on one hand if the the toolbar is spared and left out of the focus area but on the other hand if the focus only highlights the actual text fields that require a text entry it might still bring more clarity to the user where interaction is exactly required
but i've noticed one other detail based on the screenshots in comment #6. the document title remains the same after the form submission failed due to a missing required field filled out properly or at all.
it might be helpful for especially screenreader users to update the document title that it shows something like
(1 error) Create Article | Drupal 9instead. that way a screenreader user has a direct feedback on page load knowing that something went wrong on form submission. another use case is for sighted users who have many tabs open. if one users gets distracted and pulled away from the computer for a while and when revisiting the browser with the updated document title it would be easily distinguishable and scanable which was the tab in question with an error.*the suggestion about the pattern for prepending
(x error(s))to thedocument.titleis from the form design patterns book by adam silverComment #16
lauriiiThe
textarea.error + .ck-editor > .ck-editor__mainselector seems good for me. It feels more accurate to not wrap the toolbar with the red border. This would be also consistent with how focus is indicated in the editable area.Comment #17
lauriiiWe should ensure there's a follow-up issue for the title proposal in #15.
Comment #18
hooroomooCreated #3261571: Prepend error to document.title when form submission fails to address #15.
Comment #19
hooroomooComment #20
wim leersPerfect! :)
Comment #21
lauriiiPosted feedback on the MR
Comment #22
hooroomooComment #23
wim leersYay, thanks @lauriii and @hooroomoo, that code definitely looks better!
Comment #24
lauriiiComment #27
lauriiiCommitted 2ae5a54 and pushed to 10.0.x. Also committed to 9.4.x. Thanks!