App: tlumienie bouncingu iOS - overscroll-behavior na html i contain w wewnetrznych scrollerach (topbar/bottom bar nie odbija sie od krawedzi)

This commit is contained in:
tisachi
2026-09-13 14:26:29 +02:00
parent d731a9155f
commit 8a885723d9
6 changed files with 8 additions and 5 deletions

View File

@@ -294,7 +294,7 @@ export function Tabs({
<div
ref={scrollRef}
onScroll={updateArrows}
className="flex gap-1 overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
className="flex gap-1 overflow-x-auto overscroll-contain [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
>
{tabs.map((t) => (
<button

View File

@@ -37,7 +37,7 @@ const DialogContent = React.forwardRef<
data-slot="dialog-content"
ref={ref}
className={cn(
'fixed inset-x-0 bottom-0 z-50 max-h-[85dvh] w-full overflow-y-auto rounded-t-2xl border border-line bg-card p-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] shadow-card',
'fixed inset-x-0 bottom-0 z-50 max-h-[85dvh] w-full overflow-y-auto overscroll-contain rounded-t-2xl border border-line bg-card p-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] shadow-card',
'sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:max-w-md sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-2xl',
'duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-bottom-2',
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',

View File

@@ -303,7 +303,7 @@ export default function MessageThread() {
{!error && thread && <ThreadContextCard thread={thread} />}
<Card ref={listRef} className="min-h-0 flex-1 overflow-y-auto">
<Card ref={listRef} className="min-h-0 flex-1 overflow-y-auto overscroll-contain">
{error && <ErrorText>Błąd: {(error as Error).message}</ErrorText>}
{!error && (thread?.messages.length ?? 0) === 0 && (
<p className="text-dim">Brak wiadomości — napisz pierwszą.</p>

View File

@@ -119,7 +119,7 @@ export function ExerciseEditor({
</div>
{/* relative: sr-only (absolute) w nagłówku nie rozlewa dokumentu poza scroll container */}
<div className="relative overflow-x-auto">
<div className="relative overflow-x-auto overscroll-contain">
<table className="w-full min-w-[460px] border-separate border-spacing-0">
<thead>
<tr>

View File

@@ -169,7 +169,7 @@ export function ExercisePicker({
role="listbox"
aria-label="Ćwiczenia"
aria-activedescendant={flat[active] ? `ex-opt-${flat[active].id}` : undefined}
className="max-h-72 overflow-y-auto -mx-1 px-1"
className="max-h-72 overflow-y-auto overscroll-contain -mx-1 px-1"
>
{flat.length === 0 && (
<p className="text-dim text-center py-6 text-[0.9rem]">

View File

@@ -197,6 +197,9 @@
@layer base {
html {
background-color: var(--bg);
/* iOS: wyłącza „gumkę" (rubber-band) dokumentu — sticky topbar i fixed bottom bar
nie odbijają się od krawędzi ekranu przy przeciąganiu poza koniec strony */
overscroll-behavior-y: none;
}
body {