From d6d2d0bf15a003c069891393fc931696ba92efd8 Mon Sep 17 00:00:00 2001 From: David Axelrod Date: Wed, 19 Jul 2023 17:25:19 +0000 Subject: [PATCH] fix: overlayPress close improvement by correctly running onComplete callback only when anim is done --- src/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 68586a5e..0bcb1a3e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -346,7 +346,10 @@ const ModalizeBase = ( toValue, useNativeDriver: USE_NATIVE_DRIVER, }), - ]).start(() => { + ]).start(({ finished }) => { + if (!finished) { + return; + } if (onClosed) { onClosed(); }