Skip to content

Commit 2470ccc

Browse files
committed
fix: RESIZE should never animate the content opacity
1 parent d5e3437 commit 2470ccc

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

pages/fixtures/experiments.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,32 @@ function Nine() {
388388
)
389389
}
390390

391+
function Ten() {
392+
const [open, setOpen] = useState(false)
393+
394+
return (
395+
<>
396+
<Button onClick={() => setOpen(true)}>10</Button>
397+
<BottomSheet
398+
open={open}
399+
onDismiss={() => setOpen(false)}
400+
defaultSnap={({ snapPoints }) => Math.max(...snapPoints)}
401+
snapPoints={({ minHeight, maxHeight }) =>
402+
[maxHeight, maxHeight * 0.7, maxHeight * 0.3].map((v) =>
403+
Math.min(v, minHeight)
404+
)
405+
}
406+
>
407+
<SheetContent>
408+
<Expandable>
409+
<div className="bg-gray-200 block rounded-md h-screen w-full my-10" />
410+
</Expandable>
411+
</SheetContent>
412+
</BottomSheet>
413+
</>
414+
)
415+
}
416+
391417
export default function ExperimentsFixturePage() {
392418
return (
393419
<Container
@@ -405,6 +431,7 @@ export default function ExperimentsFixturePage() {
405431
<Seven />
406432
<Eight />
407433
<Nine />
434+
<Ten />
408435
</Container>
409436
)
410437
}

src/BottomSheet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ export const BottomSheet = React.forwardRef<
313313
const snap = findSnapRef.current(heightRef.current)
314314
heightRef.current = snap
315315
lastSnapRef.current = snap
316-
317316
await asyncSet({
318317
y: snap,
318+
ready: 1,
319319
maxHeight: maxHeightRef.current,
320320
maxSnap: maxSnapRef.current,
321-
minSnap: defaultSnapRef.current,
321+
minSnap: minSnapRef.current,
322322
immediate: prefersReducedMotion.current,
323323
})
324324
}, [asyncSet, lastSnapRef, prefersReducedMotion]),

0 commit comments

Comments
 (0)