Keep the editor's section nav in view while scrolling

The nav was sticky inside a wrapper only as tall as itself, so it had
nowhere to travel and scrolled away. The grid cell now sticks instead,
and the mobile "Jump to" bar sits straight in the page for the same
reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 15:36:02 -05:00
parent 8186aff62f
commit 960c854611
2 changed files with 10 additions and 7 deletions

View file

@ -80,12 +80,13 @@ function Label({ section }: { section: EditorSection }) {
);
}
/* The desktop column. Place it in the grid's first track. */
/* The desktop column. Place it in the grid's first track, in a cell
that is itself sticky (see EntityEdit). */
export function SectionNav({ sections }: { sections: EditorSection[] }) {
const active = useActiveSection(sections);
return (
<nav aria-label="Sections" className="sticky top-6 hidden max-h-[calc(100vh-8rem)] overflow-y-auto lg:block">
<nav aria-label="Sections" className="hidden max-h-[calc(100vh-8rem)] overflow-y-auto lg:block">
<p className="mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-[#4a6b72]/70">
On this page
</p>
@ -119,7 +120,7 @@ export function SectionJump({ sections }: { sections: EditorSection[] }) {
const active = useActiveSection(sections);
return (
<div className="sticky top-0 z-20 -mx-6 mb-2 border-b border-[#138ba0]/15 bg-[#f6fbfc]/95 px-6 py-2 backdrop-blur lg:hidden">
<div className="sticky top-0 z-20 -mx-6 mt-4 mb-2 border-b border-[#138ba0]/15 bg-[#f6fbfc]/95 px-6 py-2 backdrop-blur lg:hidden">
<label className="flex items-center gap-3 text-sm text-[#4a6b72]">
<span className="shrink-0">Jump to</span>
<select