Problem/Motivation

the toolbar items of ckeditor 5 is overlapping with the sidebar on the node form when it's being used in a multi-value field (or whenever the editor is being embedded in a table element?) and there are many toolbar items.

Steps to reproduce

1. Do a Drupal clean install. (I use https://simplytest.me/)
2. Navigate to a content type and create a field using ckeditor 5 and allow unlimited value.
3. Move the field to the top on the form display of the content type.
4. Add more items to the ckeditor.
5. Go to the create page of the content type and resize the browser down to around 1000px (depends on the number of the toolbar items)
6. See the overlapping issue.

Proposed resolution

https://github.com/ckeditor/ckeditor5/issues/11334 → points out this is because when CK5 is inside an element that can dynamically change width to accommodate the contents, then the editor is unable to determine if there are excess toolbar elements that need to be collapsed. To work around this for the most-common tabledrag scenario, we use JS to calculate the available width for CKEditor 5 then set a max width on the table cell, which results in a fixed width that CKEditor 5 can use to determine if the collapse ... is needed. This custom logic would retrigger any time the viewport resizes.

CommentFileSizeAuthor
#105 3332416-105-ckeditor-toolbar-collapse.patch19.85 KBdabbor
#101 Ckeditor5OverlappinginDrupal1053.png93.07 KBlogeshvaran
#100 drupal-ckeditor_paragraph_overflow_sidebar-3332416-100-d11.patch3.55 KBgun2dru
#96 3332416-before-MR5728-after-90per.png300.26 KBnayana_mvr
#96 3332416-before-MR5728-after-100per.png312.45 KBnayana_mvr
#96 3332416-before-MR5728.png283.18 KBnayana_mvr
#92 after.png55.28 KBamitrawat056
#92 before.png88.15 KBamitrawat056
#84 3332416-nr-bot.txt1.59 KBneeds-review-queue-bot
#83 after.png212.5 KBtirupati_singh
#83 before.png229.88 KBtirupati_singh
#80 ckeditor_overflow.png32.96 KBeduardo morales alberti
#79 3332416-79.patch13.95 KBlobodakyrylo
#77 Screenshot 2024-03-27 173719.png592.3 KBdbuzinov
#67 3332416-67-seven.patch8.74 KBpminf
#67 3332416-67.patch8.72 KBpminf
#58 3332416-58.patch2.97 KBvasantha deepika
#54 Screenshot 2024-02-15 at 5.29.53 PM.png102.67 KByogen.prasad
#53 3332416-seven-theme-53.patch4.71 KBjoevagyok
#53 3332416-53.patch4.71 KBjoevagyok
#50 3332416-seven-theme-50.patch4.71 KBjoevagyok
#49 3332416-49.patch4.71 KBjoevagyok
#47 Screenshot 2023-12-07 at 4.27.58 PM.png225.96 KBsmustgrave
#37 Grabación de pantalla desde 2023-10-19 19-38-54.mp44.62 MBobiwankenobi
#32 interdiff-27_31.txt950 bytesgauravvvv
#31 interdiff-27_31.patch950 bytesgauravvvv
#31 3332416-31.patch1.07 KBgauravvvv
#28 Screenshot 2023-09-27 at 9.40.56 AM.png9.65 KBsmustgrave
#27 interdiff-25_27.txt1.31 KBgauravvvv
#27 3332416-27.patch1.05 KBgauravvvv
#25 ckeditor5-ckeditor5_toolbar_items_overflowing-3332416-25.patch550 bytesandikanio
#3 iShot_2023-01-12_09.55.12.png62.44 KBsker101
iShot_2023-01-10_14.22.46.png107.82 KBsker101
iShot_2023-01-10_14.29.12.png582.11 KBsker101

Issue fork drupal-3332416

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sker101 created an issue. See original summary.

wim leers’s picture

Title: CKEditor 5 Toolbar Items of Multi-Value Field Overlapping On Node Form » [upstream] CKEditor 5 Toolbar Items of Multi-Value Field Overlapping On Node Form
Issue tags: +CSS, +Needs steps to reproduce, +Needs upstream bugfix

Excellent find + bug report!

Could you please reduce this to the most minimal circumstances possible? This is AFAICT an upstream bug, and hence we'll need to provide clear steps to reproduce.

(Asking them to install Drupal and configure it in a specific way is too difficult a way to reproduce.)

sker101’s picture

StatusFileSize
new62.44 KB

@Wim Leers
This looks indeed an upstream issue, I created a demo here on Codepen and I think it's clear enough to see where the issue is.

The solution of removing "nowrap" doesn't look like a good approach to fix the issue as it's breaking the default behavior of the editor which wraps all the items into a popup when there are too many items.

I guess it's up to the devs of ckeditor to decide what's the best solution here.

sker101’s picture

Looks like this is also an issue when the editor is wrapped inside a fieldset element and someone opened an issue on the repo of ckeditor 5.
See Issue

sker101’s picture

After looking into the code of ckeditor, I don't think it could be easily fixed from upstream as they might need to change the way of how to calculate if the toolbar items are overflowing or not.

Currently, Ckeditor 5 relies on the `resize` event to determine if the toolbar items should be wrapped inside a popup. However, the event doesn't seem to be triggered for the toolbar element when it's embedded in a table or fieldset as the flex styling isn't being resized correctly when a flex element is wrapped inside in the two said elements above and this seems to be the default behavior of current browsers (tested on Chrome/Safari).

See this codepen link for example.

I tried to see if we could replace the table used in the multivalue field to use div instead but looks like Drupal core is using tabledrag to handle the ordering and I assume we don't (can't) switch it to use div?

wim leers’s picture

Excellent research, @sker101!

Could you please report this at https://github.com/ckeditor/ckeditor5? 🙏 😊

wim leers’s picture

sker101’s picture

@Wim Leers
There is a similar issue on ckeditor5's repo but haven't been responded by anyone for about a year.

wim leers’s picture

Issue summary: View changes
Status: Active » Postponed

Perfect! I missed that! 😅 Relayed your suggestion there: https://github.com/ckeditor/ckeditor5/issues/11334#issuecomment-1405201841 — and pinged the CKEditor 5 project lead that issue 👍

wim leers’s picture

Status: Postponed » Postponed (maintainer needs more info)
Related issues: +#3326431: Toolbar is not responsive

I just realized that this bug had been previously reported at #3326431: Toolbar is not responsive. There I wrote:

IIRC this is related to the shouldNotGroupWhenFull setting. If you remove all toolbar separators, then it will actually behave responsively. Could you give that a try?

and @DieterHolvoet responded:

I removed all separators and I set a breakpoint in CKEditor5::getJSSettings to make sure shouldNotGroupWhenFull is FALSE, and it is. If I add a text field directly to a node the grouping now works, if I add it to a paragraph it doesn't work and it still overflows the page. Does that make this a Paragraphs issue?

It looks like this may be a problem specific to Paragraphs' CSS … because both the bug reported here and there is only occurring in the context of Paragraphs.

Can you please investigate if you can reproduce this without Paragraphs? 🙏

wim leers’s picture

Title: [upstream] CKEditor 5 Toolbar Items of Multi-Value Field Overlapping On Node Form » [upstream] CKEditor 5 toolbar items of multi-value field (typically Paragraphs) overflowing on narrow viewports and overlapping with node form's sidebar on wide viewports
sker101’s picture

Hi, @Wim Leers

I believe that this issue could happen whenever the ckeditor is embedded inside a table element, for example, a text field that supports multiple values.

See the reproducible steps that I have on the main post.

1. Do a Drupal clean install. (I use https://simplytest.me/)
2. Navigate to a content type and create a text field that uses ckeditor 5 and allow unlimited value.
3. Move the field to the top on the form display of the content type.
4. Add more items to the ckeditor.
5. Go to the create page of the content type and resize the browser down to around 1000px (depends on the number of the toolbar items)
6. See the overlapping issue.

Wim Leers credited lauriii.

Wim Leers credited Reinmar.

wim leers’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Active
Issue tags: -Needs steps to reproduce

@sker101 Thank you!

Also discussed this with @Reinmar from CKEditor 5, as well as @lauriii!

This bug has not been reported by other CKEditor 5 users; it looks like it's specific to a very particular container markup+CSS situation. @lauriii, @Reinmar and I agreed that it'd be best to solve this problem on the Drupal side, not upstream.

Les_Paul’s picture

Got the same issue. Claro admin theme + Paragraphs.

adstokoe’s picture

Not a long term fix but the below css change fixes the issue in Gin:

.paragraphs-subform {
  width: calc(100% - 18px) !important;
}
rgpublic’s picture

I fixed this by adding this to the admin stylesheet:

.ck.ck-toolbar.ck-toolbar_grouping > .ck-toolbar__items {
    flex-wrap: wrap;
}

Perhaps this is useful for anyone.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

patrick.thurmond@gmail.com’s picture

The approach in #19 works for me. Except I added the css to a custom module I was already using as a new library. Then used MYMODULE_preprocess_page to attach the CSS.

That said, this overrides the hiding of the controls behind the triple-dot menu, which I think is cleaner. Its got to be JS that is doing that hiding because if I disable my new css in the browser in places it worked fine already it looks broken now. Let me think on this issue.

bob.hinrichs’s picture

Just chiming in, that we observed this issue in a form that is using the ever-popular inline_entity_form module to manage related entities to a node. One can see that inline_entity_form uses tables. In light of others working on this issue with CKE5, we worked around the issue by editing the toolbar in the text filter configuration to add line breaks into the toolbar. This eliminates the nice vertical-dots-see-more feature of the cke5 toolbar and does not look as nice, but it stops the toolbar from pushing out the editor's width.

sonvir249’s picture

The approach in #19 worked for me.

bvoynick’s picture

Title: [upstream] CKEditor 5 toolbar items of multi-value field (typically Paragraphs) overflowing on narrow viewports and overlapping with node form's sidebar on wide viewports » CKEditor 5 toolbar items of multi-value field (typically Paragraphs) overflowing on narrow viewports and overlapping with node form's sidebar on wide viewports
andikanio’s picture

Here is the #19 approach via claro in case someone else need it,
I'm not sure where to put it, so I just pick one of the css and apply patch on it.

bvoynick’s picture

Issue tags: -Needs upstream bugfix
gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB
new1.31 KB

Patch #25, made directly changes to css file also using ! important; I have made changes into pcss fle and updated the patch and attached the interdiff

smustgrave’s picture

Status: Needs review » Needs work
StatusFileSize
new9.65 KB

Patch didn't seem to solve the issue. Think we need to figure out how to trigger

trigger

edit

@Wim Leers is it an upstream issue where it doesn't pick up the width correctly?

willempje2’s picture

Patch #25 works for me.
Unfortunately patch #27 does not, only works with the "!important" added to the style.

yfma’s picture

Patch #25 is working for us on core 10.1.4

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new950 bytes

Added !important to flex wrap. attached interdiff for same.

gauravvvv’s picture

StatusFileSize
new950 bytes
smustgrave’s picture

Think my comment in #28 could still be relevant.

Wondering if an upstream issue where the three dots aren’t appearing.

sker101’s picture

@smustgrave
It's because the resize event not being triggered correctly, I had an explanation and example in comment #5

smustgrave’s picture

Status: Needs review » Postponed

Thanks @sker101 for pointing out!

Think this needs to be fixed upstreamed still. So I'm repostponing this per #9

#31 makes it wrap like it did in ckeditor4.

So based on the IS screenshots we would have one text field behaving correctly and others behaving differently which I don't think is desired.

Hopefully upstream fix will address #3328095: CKEditor 5 toolbar overflow can become unusable in Off canvas as well.

wim leers’s picture

Status: Postponed » Postponed (maintainer needs more info)

Per #16, we should fix this on our end. Unless we've found a upstream blocker that makes it impossible to fix on our end? 🤔

obiwankenobi’s picture

The sticky toolbar seems to fix the editor size issue when scrolling, and it happens in a fresh install (without paragraphs).

1. Launch a site (simplytest.me)
2. In the Basic HTML config page, add many items to the editor's toolbar (multivalued or not)
3. Save it
4. Create a new Article
5. The body field will cause the right sidebar to extend beyond the viewport.
6. Focus the editor, and scroll
7. The editor will change its size.

I'm attaching a video.

As a workaround, you could add the wrapping button to the CKEditor toolbar at the end of the line. This would show the toolbar in two lines if necessary, and would not overlap the right sidebar.

kleve’s picture

Patch from #31 works when aggregation of css is disabled on the performance settings page. But not when enabled.

Solution for me was to add it to a custom module until bug is fixed.

MODULENAME.libraries.yml

admin_theme_fixes:
  css:
    theme:
      src/css/admin-theme-fixes.css: {}

admin-theme-fixes.css

.ck.ck-toolbar.ck-toolbar_grouping > .ck-toolbar__items {
  flex-wrap: wrap !important;
}

MODULENAME.module

function MODULENAME_form_alter(&$form, &$form_state, $form_id) {
  $form['#attached']['library'][] = 'MODULENAME/admin_theme_fixes';
}

wim leers’s picture

wim leers’s picture

meryem dibe’s picture

Hello,

Any updates on the issue with the three dots not showing when there are too many items in the embedded editor within a paragraph?

Patch #31 resolves the overlap with the sidebar—thanks @Gauravvvv.

However, I still face the issue of items going to the next line even with 'shouldNotGroupWhenFull' set to False. I've found comments on a potential solution on the upstream side: https://github.com/ckeditor/ckeditor5/issues/11334, but it seems to be ongoing.

Also, there are mentions of addressing the problem on the paragraph side, but I couldn't locate a specific link to the issue.

Any updates would be appreciated.

@sker101, @Wim Leers
Thanks.

davedg629’s picture

I'm having the same issue as @Kleve in #38 with the patch only working when CSS Aggregation is disabled.

Instead of adding a custom module, I added the CSS to a ckeditor5.css file in my theme and included that css file by editing THEME.info.yml like this:

ckeditor5-stylesheets:
  - css/ckeditor5.css

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Status: Postponed (maintainer needs more info) » Needs review

The CKEditor 5 upstream issue looks tricky and I'm unsure how long it might take to get a fix there.

However, this is something that can be addressed on Drupal's end for at least one very common use case: when used inside tabledrag. We know enough about the structure it will be in that we can use some custom JS to set the CKEditor-containing table cell to a max-width, which will result in the editor properly implementing any needed ... and keeping the editor width within the table it belongs to.

I added a solution to the MR. It would benefit from tests, but it also seems difficult to test but maybe there's something elegant I'm overlooking.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update
StatusFileSize
new225.96 KB

Hiding patches for clarity

verified

Show the fix is working but seems that a different solution was proposed could that be added to the issue summary.

As far as a test case maybe could test that at browser size 1000 the ckeditor box = xyz ? Could that cause randoms to appear though?

bnjmnm’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update
joevagyok’s picture

StatusFileSize
new4.71 KB

Uploading patch version of the 5728 merge request for composer patching for the meantime. As it works fine for us.

joevagyok’s picture

StatusFileSize
new4.71 KB

Adding the same patch, only changing the isInsideTabledrag selector to make it work with Seven administration theme.

penyaskito’s picture

We detected this issue with our project automated tests (Playwright, sadly won't help here) as soon as we updated to ckeditor5 when running for mobile devices (we use Claro).

With the patch at #49 _some_ of our tests are back to green. I still need to figure out what's the case where this is still happening.

I'm surprised that per #50, Seven uses different classes for the draggable tables. Assuming Seven is still supported, what could be a desirable solution here? Is there any other selector we can use that could work for both while this is fixed upstream?

antoniya’s picture

#49 & #50 both introduce a typo in:

window.ddEventListener('resize', editorFitInTable);

Note the 'a' missing in 'addEventListener' method.

joevagyok’s picture

StatusFileSize
new4.71 KB
new4.71 KB

Thank you for noticing, I fixed the typo in the MR and re-upload the two patches for composer patching.

yogen.prasad’s picture

Issue summary: View changes
StatusFileSize
new102.67 KB

After applying the patch the Safari browser and CKeditor5 :

Fields are getting compressed.

joevagyok’s picture

Double check if you are using the correct patch for your theme! As I see you have seven, so use the patch made for seven theme!

vasantha deepika’s picture

Hi,

It is happening when we are placing the filed inside the field group with Accordion, tab and detailed configuration. Working on this issue. Due to hide and show the width it not calculating from the parent.

Thanks!

vasantha deepika’s picture

Assigned: Unassigned » vasantha deepika
vasantha deepika’s picture

Assigned: vasantha deepika » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.97 KB

I fixed the issue mention in comment #54 and re-upload the Patches.

joevagyok’s picture

Status: Needs review » Needs work

Thanks, but the work is ongoing in the merge request and not with patch files! I clearly stated that the patches in #53 are meant to be used for composer patching. Also, changes missing from your patch which are present in the merge request. Please, make sure you work on the latest code and add your changes are in the merge request so we can review your commit. Nevertheless, #47 was not addressed yet.
Removing patches for clarity.

dianacastillo’s picture

fixed as in #22 by editing the toolbar in the text filter configuration to add line breaks into the toolbar.

vasantha deepika’s picture

Status: Needs work » Needs review

Hi,
Based on the comment #59 I've created a commit for the changes.
Kindly review and let me knows if anything need to be done further.

Thanks!

smustgrave’s picture

Status: Needs review » Needs work

MR appears to have failures.

kolesnikoff made their first commit to this issue’s fork.

kolesnikoff’s picture

Status: Needs work » Needs review

Merging the branch with the upstream fixed MR failures.
Please review and test.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Re-verified this bug following the steps mentioned. Actually was even able to trigger it when switching text formatters between basic and full.
Applying the MR did resolve the problem.

Know it wasn't in scope but also tested #3328095: CKEditor 5 toolbar overflow can become unusable in Off canvas while I was at it and unfortunately that issue still remains.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

some more things to fix

pminf’s picture

StatusFileSize
new8.72 KB
new8.74 KB

Here is a patch for the latest changes and an additional one with changes from #53 to support seven theme. Not sure if this theme should be supported and therefore to be addressed in the MR.

dbuzinov’s picture

I am currently working on resolving the issues and suggestions that have been pointed out after review.

dbuzinov’s picture

Status: Needs work » Needs review

Please review and test.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Appears feedback from @nod_ has been addressed

nod_’s picture

Status: Reviewed & tested by the community » Needs work

couple more comments

nod_’s picture

I think we'll need to improve the performance here. What happens when there are 20 editors in the same tabledrag? we'll compute the width 20 times on resize instead of once for all the editors. Need to try with 20 ish editors in a single tabledrag and see what perf is like.

dbuzinov’s picture

Status: Needs work » Needs review

MR was updated. Also, I did some optimization: the calculation of max-width now will be executed only once for the table. Please test and review.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Nice update!

Still working for me.

matthieuscarset’s picture

Status: Reviewed & tested by the community » Needs work

Marking as NW because the issue still exist even with patches applied on Drupal 10 (tested with 10.2.2 with a CKE5 text editor in a paragraph field + the Gin theme). Not sure if we want to backport the fixes to D10 though 🤷

Feel free to disregard if we only want to fix this on D11.

joevagyok’s picture

@matthieuscarset we are using the solution in a paragraph field with Seven theme and Claro over D10. I think the problem will be theme related, so the selector in the JS might not apply for Gin theme.

dbuzinov’s picture

StatusFileSize
new592.3 KB

@matthieuscarset I believe the problem is theme-related. I investigated the issue with the Gin theme, so the issue is in empty TD that has 100% width in CSS rules that came in the end with negative max-width (see img - I have applied the proposed CSS, for testing and it works). As for me, the easiest solution will be just to add/update or alter the theme CSS to something like:

[data-drupal-calibrate-width] td:empty {
  width: auto !important;
}

Note: also figured out the issue with the incorrect position of the drag-cell icon and here is the CSS fix:

[data-drupal-calibrate-width] td.tabledrag-cell--only-drag {
  display: table-cell;
}

But I think it is not related to this issue and is related to the theme CSS. Any thoughts on this?

CSS

dbuzinov’s picture

lobodakyrylo’s picture

StatusFileSize
new13.95 KB

After 10.2.5 the patch stoped working. I quickly fixed it.

eduardo morales alberti’s picture

StatusFileSize
new32.96 KB

After applying the last patch #79 the CKEditor appearance is not right.

CKEditor overflow

davedg629’s picture

I upgraded to Drupal 10.2.5 and I'm not seeing any issues. I'm not using any patches though. I added the CSS from #38 to my theme using the method described in #43.

tirupati_singh’s picture

Assigned: Unassigned » tirupati_singh
tirupati_singh’s picture

Assigned: tirupati_singh » Unassigned
Status: Needs work » Needs review
StatusFileSize
new229.88 KB
new212.5 KB

Hi, made some changes for the CKEditor toolbar overflow issue. Please review the changes made. Attaching before and after changes screenshots for reference.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.59 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

underscore_boy’s picture

Hello, a ";" is missing. line 38 to pass prettier.

tirupati_singh’s picture

Status: Needs work » Needs review

@underscore_boy, I've fixed the css syntax error. Thanks for figuring out.

Mithun S made their first commit to this issue’s fork.

mithun s’s picture

Resolved the merge conflicts and added a rebase for the MR. Please review.

smustgrave’s picture

@matthieuscarset are you still seeing the issue you mentioned?

smustgrave’s picture

Status: Needs review » Needs work

Left a comment on an open thread

davedg629’s picture

I'm on Drupal 10.3.2 and the CSS code from #38 no longer works. I applied the patch (Merge request !5728), but that didn't do anything (although I see the changes from the patch were made to the core files).

Is there a fix for Drupal 10.3?

amitrawat056’s picture

StatusFileSize
new88.15 KB
new55.28 KB

.ck.ck-toolbar.ck-toolbar_grouping > .ck-toolbar__items {
flex-wrap: wrap !important;
}

This CSS code still work for me, i m on Drupal 10.3.3

davedg629’s picture

Thanks for checking this. The CSS is indeed still working, I just discovered a related bug.

There is an issue where if you have a large inline image in one of the nested text editors, it causes overlap issues with the sidebar. To fix, I added this CSS which limits the width of the inline images to 800px wide.

.ck.ck-editor__editable .image-inline {
  max-width: 800px;
}
sriharsha.uppuluri’s picture

After adding the wrapper icon in Editor settings as attached the editor is behaving responsive.

full

Responsive Laptop Screen

editor-settings

Responsive Monitor Screen

responsiveness

dioni’s picture

Thanks @sriharsha.uppuluri, that is the only way I could make it responsive

nayana_mvr’s picture

This issue is related to CkEditor field with unlimited values right? But after applying the changes of MR! 5728, it is affecting the CkEditor field with limited values also as mentioned in #3

The solution of removing "nowrap" doesn't look like a good approach to fix the issue as it's breaking the default behavior of the editor which wraps all the items into a popup when there are too many items.

Before:

before

After:

With 100% resolution
after-1

With 90% resolution
after-2

I think the following code is causing this:-

@media screen and (max-width: 90rem) {
  .ck .ck-editor__top .ck.ck-toolbar.ck-toolbar_grouping > .ck-toolbar__items {
    flex-wrap: wrap;
  }
}

Is it a new change that is expected where the toolbar dropdown option will be visible only for screen width above 1440px?

natefollmer’s picture

This issue just popped up after I updated a site to 10.4.4. It's reproducible by putting the ckeditor inside any container that doesn't have a fixed wdith. I was able to fix the issue by using the wrapper icon, but cannot get the editor to stay within it's parent element otherwise. These are single value long text fields.

andrewtylernally changed the visibility of the branch 11.x to hidden.

andrewtylernally changed the visibility of the branch 11.x to active.

gun2dru’s picture

logeshvaran’s picture

StatusFileSize
new93.07 KB

I have set up a fresh Drupal 10.5.3 installation locally and added content using unlimited Paragraph components. However, the text containers are overlapping with the fields on the right side. Please refer to the attached screenshot

rouaida made their first commit to this issue’s fork.

oily made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

dabbor’s picture

StatusFileSize
new19.85 KB

I'm attaching a patch from: https://git.drupalcode.org/project/drupal/-/merge_requests/5728.patch to have a static version of the patch that is safe to reference from composer.

r.e.younan’s picture

We reproduced the same behavior on Drupal 11 with Claro and Paragraphs (unlimited values / nested table markup).

Symptoms
- On node (entity) edit, a CKEditor 5 field inside Paragraphs shows the full toolbar row (e.g. .ck-toolbar__items) at an unrealistically large width (we saw negative left offsets and ~1000px+ widths in devtools).
- The same text format in the node “Description” (body) field correctly collapses extra controls into the overflow (“…” / “Show more items”) control.

What we think is going wrong
- ClassicEditor.create() registers instances in Drupal.CKEditor5Instances only after the promise resolves (async).
- In table / multi-value widget markup, the .ck-editor box can effectively grow with the toolbar, so measuring only the editor chrome does not give CKEditor a smaller “available width” than the intrinsic toolbar width — grouping never triggers.
- After Paragraphs AJAX and toggles, width needs to be recomputed again.

Interim workaround (JS, theme-agnostic enough for Claro entity forms)
- After editors exist, walk Drupal.CKEditor5Instances and set toolbar.maxWidth to a conservative pixel value derived from:
- Claro main column: .layout-form .layout-region--main .layout-region__content (with a couple of fallbacks),
- the field’s .form-textarea-wrapper,
- and the nearest table td when present,
- taking min(...) minus a small gutter, floored with a minimum (we used 280px).
- Apply both the observable (toolbar.maxWidth) and an inline max-width on the toolbar element so grouping recalculates.
- Re-run on: delayed timers (0/250/750/2000ms to catch async create), window load, window resize (debounced), jQuery ajaxComplete, toggle, and a debounced MutationObserver on document.body.

We packaged this as a small standalone module (no Paragraphs dependency) so sites can opt in without patching core:
https://github.com/osark/ckeditor5_toolbar_reflow.git
Release / tag: 1.0.0

Caveats
- Other admin themes (Gin, etc.) may need extra selectors in getMainColumnElement().
- Heavy MutationObserver is a tradeoff; a core fix might hook editor attach lifecycle instead.

If useful, we can help turn this into a proper MR against drupal/core (ckeditor5) or iterate as a contrib project — feedback welcome.

prudloff changed the visibility of the branch 11.x to hidden.