Skip to content

Show the action title in mobile text editor toolbar drops - #3399

Merged
kulmann merged 1 commit into
mainfrom
fix/mobile-toolbar-drop-title
Sep 18, 2026
Merged

kulmann merged 1 commit into
mainfrom
fix/mobile-toolbar-drop-title

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Description

Toolbar menus in the text editor turn into a bottom drawer on mobile. OcDrop renders its title prop as the drawer header, but TextEditorToolbarItem never passed one, so the header stayed empty and the drawer opened without any indication of what it belongs to. This was most noticeable on "Insert image" and "Create a table".

The fix passes the action title on both drop levels:

  • the toolbar drop gets :title="item.title" — e.g. "Insert image", "Create a table"
  • the nested drop of a child action gets :title="child.title" — e.g. "Choose rows & columns", which is the drawer holding the mobile table size picker

All toolbar menus that become a drawer were affected, not just those two: font size, text align, turn into, text colour, background colour and line height get a header now as well. "Insert emoji", "Search and replace" and the overflow menu were never affected because they set menuEnforceDropOnMobile and stay popovers.

While at it, the nested drop read the parent's menuEnforceDropOnMobile flag instead of the child's. No behaviour changes today since no child action sets it, but the setting would have been silently ignored the first time one did.

Related Issue

How Has This Been Tested?

  • test environment: local dev server (pnpm vite), Chrome DevTools device emulation below the 640px mobile breakpoint; unit tests via pnpm test:unit --run
  • test case 1: open the text editor on a mobile viewport, tap the image toolbar button — the bottom drawer is headed "Insert image"
  • test case 2: tap the table toolbar button — the bottom drawer is headed "Create a table"; tap "Choose rows & columns" inside it — the nested drawer is headed "Choose rows & columns" and shows the table size picker
  • test case 3: the remaining menu actions (font size, text align, turn into, text/background colour, line height) all show their title as the drawer header
  • test case 4: on a desktop viewport the drops are unchanged — title is only rendered by the mobile drawer
  • test case 5: new unit tests in TextEditorToolbarItem.spec.ts assert the title reaches both drop levels; both fail without the fix
  • test case 6: pnpm check:all — types, lint, format and 4100+ unit tests pass

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear self-assigned this Sep 17, 2026
Toolbar menus such as "Insert image" and "Create a table" turn into a
bottom drawer on mobile. OcDrop renders its `title` prop as the drawer
header, but the toolbar never passed one, so the header stayed empty.

Pass the action title on both the toolbar drop and the nested drop of a
child action, e.g. the table size picker behind "Choose rows & columns".
While at it, the nested drop read the parent's `menuEnforceDropOnMobile`
flag instead of the child's.
@AlexAndBear
AlexAndBear force-pushed the fix/mobile-toolbar-drop-title branch from 3ba6847 to dd44868 Compare September 17, 2026 15:15
@kulmann
kulmann merged commit 0d15257 into main Sep 18, 2026
31 checks passed
@kulmann
kulmann deleted the fix/mobile-toolbar-drop-title branch September 18, 2026 07:19
@openclouders openclouders mentioned this pull request Sep 18, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text editor toolbar menus open without a title in the mobile bottom drawer

2 participants