# Bug AA-238 - CKEditor toolbar menus are cut off or covered by surrounding content

Project: Stream Agents & Assistants
Status: merged
URL: https://community.openproject.org/work_packages/AA-238

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Artificial Intelligence / AI text helper (AITH) |
| Target versions | 18.0.0 |
| Observed in versions | 18.0.0 |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager | Dominic Bräunlein |
| Developers | Alexander Coles |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Work |  |
| Labor costs |  |

## Description

**Summary**

Toolbar menus in CKEditor are cut off or drawn behind other content depending on where the editor sits. This affects the Assistant menu, the &quot;Show more items&quot; (⋮) menu and the other toolbar dropdowns. It happens on the project overview, in the work package activity tab and in work package forms with several long-text fields.

**Steps to reproduce**

Precondition: AI text actions are enabled and at least one text action exists, so the Assistant split button shows in the editor toolbar.

**Case 1**

1.  Open a project overview and click into the Description widget to edit it.
    
2.  Click &quot;Show more items&quot; (⋮) in the editor toolbar.
    
    <br>
    

**Case 2**

1.  Open a work package and focus the comment editor at the bottom of the Activity tab.
    
2.  Click the arrow of the Assistant split button.
    

**Case 3**

1.  Open a work package whose type has two long-text custom fields one below the other.
    
2.  Click the arrow of the Assistant split button in the first field&#x27;s editor.
    

**Actual behavior**

*   **Case 1:** the ⋮ menu is cut off on the left. It is aligned to the ⋮ button, which is no longer at the end of the toolbar because the Assistant button follows it. The widget (`.widget-box { overflow: hidden }`) clips the part that sticks out.
    
*   **Case 2**: the Assistant menu only opens downward and runs out of the visible area.
    
*   **Case 3:** the Assistant menu is drawn underneath the toolbar of the second editor.
    

**Expected behavior**

*   Toolbar menus are always fully visible and drawn above the surrounding content.
    
*   A menu opens upward when there is not enough room below it.
    
*   Menus that are too long for the available space scroll.
    
*   The ⋮ menu stays within the width of the toolbar.
    

**Environment**

OpenProject release/18.0, CKEditor 49.0.1.

**Screenshots and attachments**

**Case 1**

<img class="image_resized op-uc-image op-uc-image_inline" style="width:418px;" src="/api/v3/attachments/927011/content">

**Case 2**

<img class="image_resized op-uc-image op-uc-image_inline" style="width:386px;" src="/api/v3/attachments/927012/content">

<br>

**Case 3**

**<img class="image_resized op-uc-image op-uc-image_inline" style="width:394px;" src="/api/v3/attachments/927013/content">**

**Additional context**

Cause: CKEditor positions each dropdown menu absolutely inside its dropdown. Any container around the editor that has `overflow` set, or its own stacking context, clips or covers the menu. Each `.document-editor__toolbar` is `position: sticky; z-index: 3`, so a toolbar further down the page covers the menu of an editor above it.

Fix for opf/commonmark-ckeditor-build:

*   Toolbar dropdown menus open in the browser&#x27;s top layer (Popover API, `popover="manual"`).
    
*   The menu is positioned in JavaScript: below the button, or above it when there is more room there, aligned to the end of the button, clamped to the viewport.
    
*   The ⋮ menu aligns to the end of the toolbar.
    
*   The menu follows the button on scroll and resize, and closes once the button is no longer visible.
