diff --git a/example/src/ToastDemo.tsx b/example/src/ToastDemo.tsx index b05c523..b89aa35 100644 --- a/example/src/ToastDemo.tsx +++ b/example/src/ToastDemo.tsx @@ -417,7 +417,7 @@ export const ToastDemo: React.FC = () => { title="OnPress action" onPress={() => { const id = toast.success('OnPress action', { - dismissible: true, + dismissible: false, onPress: () => { toast.dismiss(id); setToastId(null); diff --git a/src/gestures.tsx b/src/gestures.tsx index 1055439..e1fb522 100644 --- a/src/gestures.tsx +++ b/src/gestures.tsx @@ -105,10 +105,9 @@ export const ToastSwipeHandler: React.FC< }); const tap = Gesture.Tap().onEnd(() => { - if (!enabled) { - return; + if (onPress) { + runOnJS(onPress)(); } - runOnJS(onPress)(); }); const animatedStyle = useAnimatedStyle(() => { diff --git a/src/toast.tsx b/src/toast.tsx index f744eaa..982d65e 100644 --- a/src/toast.tsx +++ b/src/toast.tsx @@ -289,7 +289,7 @@ export const Toast = React.forwardRef( } }} onPress={() => onPress?.()} - enabled={onPress ? true : !promiseOptions && dismissible} + enabled={!promiseOptions && dismissible} style={[toastContainerStyleCtx, styles?.toastContainer]} className={cn( classNamesCtx?.toastContainer,