Skip to content

cms-admin: Make TipTap rich text block toolbar sticky - #6210

Open
VPS-Andreas wants to merge 4 commits into
mainfrom
claude/tiptap-toolbar-sticky-aqatq5
Open

cms-admin: Make TipTap rich text block toolbar sticky#6210
VPS-Andreas wants to merge 4 commits into
mainfrom
claude/tiptap-toolbar-sticky-aqatq5

Conversation

@VPS-Andreas

Copy link
Copy Markdown

Description

In the TipTap-based rich text block (createTipTapRichTextBlock), the toolbar (Bold, Headline levels, etc.) scrolled away with the editor content on longer texts. The previous Draft.js-based rich text editor kept its toolbar fixed at the top while scrolling, so format options were always reachable.

The toolbar's root Box in TipTapToolbar.tsx had no position: sticky. The equivalent Draft.js toolbar (@dextinity/admin-rte's Toolbar.styles.tsx) already uses position: sticky; top: 0; z-index: 2, so this change mirrors that.

Solution

Added position: sticky, top: 0, and zIndex: 2 to the toolbar's root Box sx in packages/admin/cms-admin/src/blocks/tipTap/TipTapToolbar.tsx, matching the old Draft.js RTE toolbar behavior.

Example

Rich Text (TipTap) or Headline Rich Text block in the admin: enter enough text to make the editor scrollable, then scroll down — the toolbar now stays fixed at the top.

Changeset

Added (@dextinity/cms-admin, patch).

Open TODOs/questions

None.


Generated by Claude Code

The toolbar scrolled away with the editor content on longer texts,
unlike the previous Draft.js-based rich text editor where the toolbar
stayed fixed at the top while scrolling. Add position: sticky to match
the old behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9QpQ6ZCDhw22zaY7GtxMi
@nsams

nsams commented Aug 18, 2026

Copy link
Copy Markdown
Member

please provide a link the the deployed storybook (pr deployment) where we can see it in action

@VPS-Andreas
VPS-Andreas removed the request for review from VPS-Obi August 18, 2026 08:49
@nsams

nsams commented Aug 18, 2026

Copy link
Copy Markdown
Member

@nsams

nsams commented Aug 18, 2026

Copy link
Copy Markdown
Member

maybe you can add an interactive storybook test that tests this new behaviour

claude added 3 commits August 18, 2026 10:59
Add a play-function test that scrolls a constrained container and
verifies the toolbar's bounding rect stays pinned while the editor
content scrolls behind it, guarding the sticky positioning fix
against regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9QpQ6ZCDhw22zaY7GtxMi
The scroll container was queried once, synchronously, before Chromatic
had mounted the story, so the play function crashed with "Cannot read
properties of null". Query it inside waitFor so it retries until the
component is mounted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9QpQ6ZCDhw22zaY7GtxMi
On a cold-loaded deployment (fresh assets, no cache), mounting and
laying out the editor with 30 paragraphs took longer than the default
waitFor timeout, failing the story on first load while a reload (warm
cache) passed. Give every waitFor in the story the same 5s timeout
already used for the initial "editor ready" check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9QpQ6ZCDhw22zaY7GtxMi
@VPS-Andreas
VPS-Andreas requested a review from nsams August 21, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants