Skip to content

Commit 594754a

Browse files
authored
fix: restore pull-to-refresh while maintaining overscroll bounce prevention of page (#528)
Previous changes to prevent overscroll bounce behavior accidentally removed pull-to-refresh functionality on mobile browsers. This fixes both issues by making the navbar properly fixed and ensuring the background color is correctly applied to the page.
1 parent 72ab6d6 commit 594754a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/Navbar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
139139
const navbar = (
140140
<div
141141
className={twMerge(
142-
'w-full p-2 sticky top-0 z-[100] bg-white/70 dark:bg-black/70 backdrop-blur-lg shadow-xl shadow-black/3',
142+
'w-full p-2 fixed top-0 z-[100] bg-white/70 dark:bg-black/70 backdrop-blur-lg shadow-xl shadow-black/3',
143143
'flex items-center justify-between gap-4',
144144
'dark:border-b border-gray-500/20'
145145
)}
@@ -498,7 +498,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
498498
const smallMenu = showMenu ? (
499499
<div
500500
className="lg:hidden bg-white/50 dark:bg-black/60 backdrop-blur-[20px] z-50
501-
sticky top-[var(--navbar-height)] max-h-[calc(100dvh-var(--navbar-height))] overflow-y-auto
501+
fixed top-[var(--navbar-height)] left-0 right-0 max-h-[calc(100dvh-var(--navbar-height))] overflow-y-auto
502502
"
503503
>
504504
<div
@@ -569,7 +569,8 @@ export function Navbar({ children }: { children: React.ReactNode }) {
569569
<div
570570
className={twMerge(
571571
`min-h-[calc(100dvh-var(--navbar-height))] flex flex-col
572-
min-w-0 lg:flex-row w-full transition-all duration-300`
572+
min-w-0 lg:flex-row w-full transition-all duration-300
573+
pt-[var(--navbar-height)]`
573574
)}
574575
>
575576
{smallMenu}

src/styles/app.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@plugin "@tailwindcss/typography";
44

5-
@custom-variant dark (&:is(.dark *));
5+
@custom-variant dark (&:is(.dark, .dark *));
66
@custom-variant light (&:is(.light, .light *));
77
@custom-variant auto (&:is(.auto, .auto *));
88
@custom-variant aria-current (&[aria-current="location"]);
@@ -68,7 +68,6 @@ button {
6868
html,
6969
body {
7070
@apply text-gray-900 bg-gray-50 dark:bg-gray-900 dark:text-gray-200;
71-
overscroll-behavior: none;
7271
}
7372

7473
.using-mouse * {

0 commit comments

Comments
 (0)