Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-sticky-editor-toolbar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@emdash-cms/admin": patch
---

The rich-text editor formatting toolbar now stays pinned to the top of the editing area while scrolling through long posts, instead of scrolling out of view. The toolbar uses `position: sticky` and the editor wrapper switched from `overflow-hidden` to `overflow-clip` so corners stay clipped without creating a nested scroll container that would break sticky positioning. Distraction-free / minimal editors (e.g. Widgets) are unaffected since they don't render the toolbar.
4 changes: 2 additions & 2 deletions packages/admin/src/components/PortableTextEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,7 @@ export function PortableTextEditor({
return (
<div
className={cn(
"border rounded-lg overflow-hidden",
"border rounded-lg overflow-clip",
minimal && "border-0 rounded-none -mx-4",
focusMode === "spotlight" && "spotlight-mode",
className,
Expand Down Expand Up @@ -2794,7 +2794,7 @@ function EditorToolbar({
ref={toolbarRef}
role="toolbar"
aria-label={t`Text formatting`}
className="border-b bg-kumo-tint/50 p-1 flex flex-wrap gap-0.5"
className="sticky top-0 z-10 border-b bg-kumo-tint p-1 flex flex-wrap gap-0.5"
onKeyDown={handleKeyDown}
>
{/* Text formatting */}
Expand Down
Loading