Skip to content

Commit 3296c87

Browse files
committed
Hide dashboard sidebar scrollbar
1 parent ee39a32 commit 3296c87

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

web/src/app/globals.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,12 @@ select {
171171
outline: none;
172172
box-shadow: 0 0 0 3px rgb(32 35 32 / 0.12);
173173
}
174+
175+
.dashboard-scrollbar-hidden {
176+
-ms-overflow-style: none;
177+
scrollbar-width: none;
178+
}
179+
180+
.dashboard-scrollbar-hidden::-webkit-scrollbar {
181+
display: none;
182+
}

web/src/components/ui/sidebar-nav.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ describe("SidebarNav", () => {
6464
expect(within(sidebar).getByRole("button", { name: "Collapse sidebar" })).toHaveClass("lg:grid");
6565
});
6666

67+
it("hides the desktop navigation scrollbar without disabling vertical scroll", () => {
68+
renderSidebar();
69+
70+
const nav = screen.getByLabelText("Dashboard navigation");
71+
expect(nav).toHaveClass("overflow-y-auto");
72+
expect(nav).toHaveClass("dashboard-scrollbar-hidden");
73+
});
74+
6775
it("wraps mobile navigation chips instead of relying on horizontal scrolling", () => {
6876
renderSidebar();
6977

web/src/components/ui/sidebar-nav.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ export function SidebarNav({
365365
</button>
366366
</div>
367367

368-
<nav aria-label="Dashboard navigation" className="mt-5 flex-1 space-y-4 overflow-y-auto pb-4">
368+
<nav
369+
aria-label="Dashboard navigation"
370+
className="dashboard-scrollbar-hidden mt-5 flex-1 space-y-4 overflow-y-auto pb-4"
371+
>
369372
{sections.map((section) => (
370373
<div key={section.id} className="space-y-2">
371374
<p className={sectionLabelClass}>{section.label}</p>

0 commit comments

Comments
 (0)