Commit 330753a
fix(Drawer): snap story enter animation clobbers snap-point transform
Problem: when the drawer opens at snap=0.5, the CSS keyframe animation
`drawer-slide-bottom-in` was animating the `transform` property from
translateY(100%) to translateY(0). Because `transform` is the same CSS
property used to apply the snap-point offset, the keyframe clobbered
the inline transform for the full 450ms of the enter animation. The
drawer slid in all the way to translateY(0) (snap=1.0), then the
animation ended and the inline transform reasserted, snapping the
drawer down to translateY(400) (snap=0.5). Visible as a brief "slide
past 50% then drop back" flicker.
Fix: switch the snap-points drawer to a dedicated `drawer-snap-slide-in`
/ `drawer-snap-slide-out` pair keyed on the independent `translate` CSS
property instead of `transform`. `translate` and `transform` are
composable: the keyframe animates `translate: 0 100dvh -> 0 0` while
the inline `transform: translateY(calc(snap-offset + swipe-y))` stays
applied throughout. Enter/exit now slide from below the viewport up to
the active snap point in a single continuous motion.
Only the snap-points drawer needs this; the regular bottom/top/left/
right variants keep the original `transform`-keyframe animations
because they have no snap-point offset to preserve.
Verified in histoire: open at 0.5 slides in to 50%, Snap 100% expands
smoothly via inline transform transition, Snap 50% returns smoothly,
Close slides off-screen. 32/32 tests still passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 745b3a0 commit 330753a
1 file changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
476 | 483 | | |
477 | 484 | | |
478 | 485 | | |
| |||
489 | 496 | | |
490 | 497 | | |
491 | 498 | | |
492 | | - | |
| 499 | + | |
493 | 500 | | |
494 | 501 | | |
495 | | - | |
| 502 | + | |
496 | 503 | | |
497 | 504 | | |
498 | | - | |
| 505 | + | |
499 | 506 | | |
500 | 507 | | |
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
504 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
505 | 518 | | |
506 | 519 | | |
507 | 520 | | |
| |||
0 commit comments