Skip to content

Commit c800992

Browse files
janpaepkefkhadra
authored andcommitted
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

File tree

src/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
}
9292

9393
.Toastify__toast {
94-
--y: 0;
94+
--y: 0px;
9595
position: relative;
9696
touch-action: none;
9797
width: var(--toastify-toast-width);

0 commit comments

Comments
 (0)