Skip to content

Commit 78dd96f

Browse files
authored
chore: horizontal swiping improvements (#566)
1 parent d6e3631 commit 78dd96f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ const Toast = (props: ToastProps) => {
353353
setSwipeOut(true);
354354
setIsSwiped(false);
355355
return;
356+
} else {
357+
toastRef.current?.style.setProperty('--swipe-amount-x', `0px`);
358+
toastRef.current?.style.setProperty('--swipe-amount-y', `0px`);
356359
}
357360

358361
setSwiping(false);

src/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ html[dir='rtl'],
248248
[data-sonner-toast][data-swiping='true']::before {
249249
content: '';
250250
position: absolute;
251-
left: -50%;
252-
right: -50%;
251+
left: -100%;
252+
right: -100%;
253253
height: 100%;
254254
z-index: -1;
255255
}

0 commit comments

Comments
 (0)