Skip to content

Commit

Permalink
fix: toast hiding even when on dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraghazra committed Oct 1, 2020
1 parent ca5bc1e commit 6b595d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/toast/ToastController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const ToastController: React.FC<ToastControllerProps> = ({
setInitialX(e.touches[0].clientX - xOffset);

setActive(true);
setDelay(null);
},
[xOffset],
);
Expand All @@ -39,7 +40,8 @@ export const ToastController: React.FC<ToastControllerProps> = ({

setInitialX(currentX);
setActive(false);
}, [active, currentX]);
setDelay(duration);
}, [active, currentX, duration]);

const drag = React.useCallback(
(e: React.TouchEvent) => {
Expand Down

0 comments on commit 6b595d6

Please sign in to comment.