Overflow toolbar hidden by vertical tabs

Created on 20 September 2024, 8 days ago

Problem/Motivation

When the CKEditor 5 overflow toolbar is shown, its left end can be hidden behind vertical tabs on an edit form. Example with horizontal tabs shows the complete toolbar:

With vertical tabs, buttons at the left end of the toolbar are hidden behind the tabs:

Steps to reproduce

Add lots of buttons to a text editor. Add a vertical tab set to the node edit form. Click on the overflow tools button and observe the overflow toolbar.

Note: this problem can be worked around by forcing the toolbar to wrap, thus eliminating the overflow toolbar entirely. However, this isn't ideal when the available width of the toolbar can be changed by hiding the right sidebar and/or by expanding the editor to full screen, either of which may allow all the buttons to appear on a single row if not for the presence of the force-wrap item.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.3

Component
CKEditor 5 

Last updated about 9 hours ago

Created by

🇺🇸United States wrd-oaitsd

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

Merge Requests

Comments & Activities

  • Issue created by @wrd-oaitsd
  • 🇮🇳India amitrawat056

    Hi
    I encountered a similar issue. If you don't need the dropdown, you can add a wrapping button, as shown in the pic.

    After adding

    However, if you do need the dropdown, you can resolve the overflow issue by adding the following CSS code:

    .ck.ck-toolbar-dropdown>.ck-dropdown__panel {
    width: 100% !important;
    }
    .ck.ck-dropdown {
    position: unset !important;
    }
    .ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw {
    top: 38px !important;
    }

  • 🇺🇸United States wrd-oaitsd

    Adding that code via ckeditor5-stylesheets does indeed seem to solve the problem -- thanks!

  • 🇮🇳India nayana_mvr

    nayana_mvr changed the visibility of the branch 3475842-overflow-toolbar-hidden to hidden.

  • 🇮🇳India nayana_mvr

    This issue exists in Drupal 11.x version. So as per the comment here https://www.drupal.org/project/drupal/issues/3471686#comment-15754893 🐛 CSS "form-item__label" inconsistent on node edit forms Needs review

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

    changing the version to 11.x

  • 🇮🇳India nayana_mvr

    I believe adding !important in code is not a good practice. There are inline styles used in ck editor, so it won't be easy to override them using css without !important unless we increase css selector specificity. I have tried a different approach by changing the max-width property value through js. Currently max-width of ck-dropdown__panel is always set to 60vw. I have added a code to dynamically change that value based on toolbar panel width. Some update in alignment may also require, but please check if this approach is useful.

    I'm unable to add the remote repo for this issue in my local. Getting the below error. SO I have created a patch. Also, attaching before and after screenshots.

    user/drupal11 % git remote add drupal-3475842 git@git.drupal.org:issue/drupal-3475842.git
    git fetch drupal-3475842
    error: remote drupal-3475842 already exists.
    remote: 
    remote: ========================================================================
    remote: 
    remote: A repository for this project does not exist yet.
    remote: 
    remote: ========================================================================
    remote: 
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
  • 🇺🇸United States wrd-oaitsd

    I removed the custom stylesheet from my theme, and applied the patch from #7, and the result looks good to me!

  • 🇺🇸United States smustgrave

    Fixes should be in MRs not patches.

    Issue summary also appears to be incomplete.

  • First commit to issue fork.
  • 🇺🇦Ukraine olmyr Ukraine, Kharkiv
  • Pipeline finished with Failed
    about 9 hours ago
    Total: 192s
    #295435
Production build 0.71.5 2024