Dropdown position is incorrect when using fullscreen inside layout builder

Created on 19 May 2024, 11 months ago

Problem/Motivation

Using fullscreen when CKEditor is inside a dialog, like off-canvas in layout builder results in positioning the dropdowns incorrectly.

Steps to reproduce

  1. With fresh Drupal 10 installation.
  2. Enable layout builder and configure "Article" content type to use it.
  3. Enable the module and add the plugin to Basic HTML text format.
  4. Go to the layout page for "Article" content type.
  5. Click "Add block", then "Create content block"
  6. Click on fullscreen button
  7. Notice how the dropdowns are positioned incorrectly resulting in having most of the options cut out.

Proposed resolution

Not sure yet.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @RedwanJamous
  • We are experiencing the same issue. Did you ever find any workaround?

  • 🇧🇪Belgium weseze

    Any solutions or workarrounds yet?
    This is blocking us from migrating our sites to ckeditor5... :(

  • 🇦🇲Armenia arthur.baghdasar

    Same issue for us

  • 🇧🇪Belgium weseze

    I have created a fix for this, patch attached. Both for the dropdowns and the baloon panels.
    It's not pretty but can't find any better way at the moment.

  • 🇨🇦Canada occupant Canada

    @weseze, this is great, thank you for this! This is a great improvement and seems to be working as expected for the most part. My best intentions to get this working have been spoiled by other concerns. It's all that is preventing a full release.

    I did notice that the .ui-dialog-buttonpane node is offscreen for dialogs and the dialog now becomes fullscreen as well, whether or not you are using layout builder.

    I think this is really close if we can isolate the dialog changes to only take place when using layout builder. Since layout builder always uses the #drupal-off-canvas-wrapper dialog, and that's the one that introduces the problematic styles, I'd suggest targeting only that dialog.

    A few updates that clear up the issues I've seen:

    • only changing the #drupal-off-canvas-wrapper dialog in the js and leaving other dialogs to work unchanged.
    • increasing the z-index for dialogs other than #drupal-off-canvas-wrapper to match the .ck-balloon-panel_visible z-index in your patch
    • removing the .ui-dialog and .ui-dialog-content styles from the patch

    One other change I'd suggest is moving the dialog-specific js out of the root directory and into the js directory.

    I've made those changes and attached a revised patch for testing.

    Thanks again!

  • 🇨🇦Canada occupant Canada

    Looking at this again, I don't know if we even need the additional javascript - if we can assume that #drupal-off-canvas-wrapper will contain the layout builder wysiwyg. The CSS updates alone look like they will be enough. I'll test further.

Production build 0.71.5 2024