Skip to content

Commit 784998d

Browse files
committed
fix: restore pull-to-refresh while maintaining overscroll bounce prevention of page
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 b514362 commit 784998d

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
@@ -145,7 +145,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
145145
const navbar = (
146146
<div
147147
className={twMerge(
148-
'w-full p-2 sticky top-0 z-[100] bg-white/70 dark:bg-black/70 backdrop-blur-lg shadow-xl shadow-black/3',
148+
'w-full p-2 fixed top-0 z-[100] bg-white/70 dark:bg-black/70 backdrop-blur-lg shadow-xl shadow-black/3',
149149
'flex items-center justify-between gap-4',
150150
'dark:border-b border-gray-500/20'
151151
)}
@@ -464,7 +464,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
464464
const smallMenu = showMenu ? (
465465
<div
466466
className="lg:hidden bg-white/50 dark:bg-black/60 backdrop-blur-[20px] z-50
467-
sticky top-[var(--navbar-height)] max-h-[calc(100dvh-var(--navbar-height))] overflow-y-auto
467+
fixed top-[var(--navbar-height)] left-0 right-0 max-h-[calc(100dvh-var(--navbar-height))] overflow-y-auto
468468
"
469469
>
470470
<div
@@ -535,7 +535,8 @@ export function Navbar({ children }: { children: React.ReactNode }) {
535535
<div
536536
className={twMerge(
537537
`min-h-[calc(100dvh-var(--navbar-height))] flex flex-col
538-
min-w-0 lg:flex-row w-full transition-all duration-300`
538+
min-w-0 lg:flex-row w-full transition-all duration-300
539+
pt-[var(--navbar-height)]`
539540
)}
540541
>
541542
{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)