Commit c800992
fix: add unit to --y CSS variable to fix vertical drag
`--y` is initialized as `0` (unitless), which works in bare
`translate3d(0, var(--y), 0)` contexts. However, when
`draggableDirection` is `'y'`, the drag handler builds
`calc(${delta}px + var(--y))` — and `calc()` requires compatible
units on both operands. `calc(50px + 0)` is invalid CSS, while
`calc(50px + 0px)` is valid.
This causes vertical drag to have no visible effect — the toast
fades via opacity but doesn't move, because the transform is
silently invalid.
Changing `--y: 0` to `--y: 0px` fixes vertical dragging with no
impact on existing behavior, since `0` and `0px` are identical
in all non-calc contexts.1 parent e4ab712 commit c800992
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments