Problem/Motivation
When using CKEditor 5 inside Drupal’s Off-Canvas dialog
(specifically within the Layout Builder workflow),
the table grid selector UI fails to position correctly.
Instead of stacking or floating as intended, the grid selector
visually overlaps the existing table toolbar, making table dimension
selection difficult or unusable.
Investigation indicates that this is not a simple z-index or rendering
issue. The behavior is consistent with a
coordinate calculation failure caused by a non-standard
containing block. The Off-Canvas container’s use of
position: fixed and constrained layout behavior interferes
with CKEditor 5’s balloon positioning engine.
Steps to reproduce
- Install Drupal 11 with the Layout Builder module enabled.
- Navigate to the Layout tab of a content item.
- Click Add block and select Create custom block
to open the Off-Canvas sidebar. - In the CKEditor 5 instance within the sidebar, click the
Insert table button. - Observe that the grid selector overlaps the table toolbar
instead of aligning correctly.
Proposed resolution
Introduce a targeted CSS adjustment in the
Claro admin theme (or core Off-Canvas styles) to ensure that
.ck-balloon-panel calculates its position correctly when nested
inside .ui-dialog-off-canvas.
The goal is to ensure that CKEditor’s positioning logic accounts for
the fixed Off-Canvas viewport rather than inheriting an invalid
coordinate context.
Remaining tasks
- Draft a CSS patch for the Claro admin theme addressing Off-Canvas balloon positioning.
- Verify that the fix does not regress balloon positioning in full-page editors.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | layout-builder-off-canvas-ckeditor-table-fix-console-proof.png | 211.48 KB | sudhan_work_contribution |
| reproduction_layout_builder.png | 39.87 KB | sudhan_work_contribution | |
| devtools_coordinate_failure.png | 200.27 KB | sudhan_work_contribution | |
| current_ui.png | 4.37 KB | anitavernes | |
| correct_ui.png | 65.41 KB | anitavernes |
Issue fork drupal-3563459
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
Comment #2
cilefen commentedI am unable to reproduce this bug as currently written. Could you please provide some additional details regarding the reproduction steps?
Comment #3
sadman commented+1 — I am also experiencing this issue and wanted to add some details that may help narrow it down. I hope this does not muddy the waters; I do not currently have a reliable way to reproduce it on a clean Drupal install.
Environment
This began occurring immediately after migrating from CKEditor 4 to CKEditor 5. CKEditor 4 has been fully uninstalled.
Where the problem does not occur:
Where the problem does occur:
There are no errors in the browser console, and the behavior does not change after Drupal cache clears, Varnish clears, or other standard cache resets.
Comment #4
sadman commentedQuick follow-up to my previous comment:
I was able to identify the root cause on my multisite installation. We are using the contrib-supported Seven theme as the admin theme, and
layout_builder_modalwas configured to use the admin theme for the modal. When I switch the modal to use our front-end theme only, the table/grid issue disappears.So in my case, the behavior was theme-related rather than a CKEditor 5 issue. Hopefully this helps others who might run into the same scenario.
Comment #5
cilefen commentedThis appears to be related to #3563459: CKEditor 5 table grid selector displays incorrectly.Comment #6
cilefen commentedI meant #3564146: CKEditor overrides admin theme.
Comment #7
quietone commentedHi, in Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Thanks.
Comment #8
cilefen commentedComment #12
sudhan_work_contribution commentedHi, I have updated the Issue Summary with a detailed root cause analysis and attached high-resolution DevTools evidence proving the coordinate calculation failure in the Layout Builder sidebar.
Comment #13
sudhan_work_contribution commentedStatus update: root cause isolated and fix direction validated
I have completed a comprehensive forensic investigation and local validation for this issue.
A concise summary is provided below.
Root cause
This is a coordinate calculation failure that occurs specifically when CKEditor 5 is rendered
inside the Layout Builder Off-Canvas dialog. The sidebar’s
position: fixedcreates a non-standard containing block that interferes withCKEditor’s balloon positioning engine.
Reproduction
Layout Builder’s Off-Canvas UI
Forensic evidence
DevTools inspection shows the internal
.ck-fake-selection-containerbeing calculated atleft: -9999px, confirming a positioning failure rather than az-index or overflow issue.
Validated proof-of-concept
I built and tested a local CSS + JavaScript workaround that:
outside the table widget after insertion
Current status
The issue is ready for maintainer guidance on the preferred permanent fix approach
(e.g. a Drupal-side Off-Canvas adjustment vs a CKEditor integration hook).
I’m currently assigned to the issue and happy to help draft or validate a core patch
once direction is confirmed.
Comment #14
avpadernoComment #15
sudhan_work_contribution commentedThanks for the review. I’m continuing to explore a core-appropriate fix direction and am happy to work on a patch once maintainer guidance is confirmed.
Comment #16
avpaderno