Skip to content

Commit

Permalink
fix progress bar stops on mobile #580
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Oct 9, 2022
1 parent 3eaed7c commit 95f4f79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ export function useToast(props: ToastProps) {
}
}

function onDragTransitionEnd() {
function onDragTransitionEnd(
e: React.MouseEvent<HTMLElement, MouseEvent> | React.TouchEvent<HTMLElement>
) {
if (drag.boundingRect) {
const { top, bottom, left, right } = drag.boundingRect;

if (
e.nativeEvent.type !== 'touchend' &&
props.pauseOnHover &&
drag.x >= left &&
drag.x <= right &&
Expand Down

0 comments on commit 95f4f79

Please sign in to comment.