mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
fix(settings): pin the settings and admin sidebars on scroll
The desktop section nav in both shells used a single sticky wrapper at top-20. Because the nav can run taller than the scroll viewport and the top offset assumed a topbar that sits outside the scroll region, the panel drifted with the content and re-pinned abruptly on scroll-up. Cap the wrapper height to the viewport and let it scroll independently (top-6, max-h-[calc(100dvh-5.5rem)], overflow-y-auto, no-scrollbar) so the nav stays pinned. Covers every /settings/* and /admin/* page through the shared shells.
This commit is contained in:
1 parent
42d49953f5
commit
d58116e3ff
2 files changed
+2
-2
No files matched your search
@@ -316,7 +316,7 @@ export function AdminShell({ active, children }: AdminShellProps) {
|
||||
aria-label={t("admin.shell.sectionsNav")}
|
||||
className="hidden md:col-start-1 md:row-start-2 md:block"
|
||||
>
|
||||
<div className="sticky top-20">
|
||||
<div className="no-scrollbar sticky top-6 max-h-[calc(100dvh-5.5rem)] overflow-y-auto">
|
||||
<ul className="space-y-1">
|
||||
<li>
|
||||
<Link
|
||||
|
||||
@@ -502,7 +502,7 @@ export function SettingsShell({
|
||||
aria-label={t("settings.shell.sectionsNav")}
|
||||
className="hidden md:col-start-1 md:row-start-2 md:block"
|
||||
>
|
||||
<div className="sticky top-20">
|
||||
<div className="no-scrollbar sticky top-6 max-h-[calc(100dvh-5.5rem)] overflow-y-auto">
|
||||
<ul className="space-y-1">
|
||||
{visibleSections.map((section) => {
|
||||
const isActive = section.slug === activeSlug;
|
||||
|
||||
Reference in new issue
Block a user