diff options
author | Bartosz Kaszubowski <gosimek@gmail.com> | 2025-08-26 21:38:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-26 14:38:59 -0500 |
commit | 8dcf1825ec3fa3a98ae8d9974434489b9b66a69b (patch) | |
tree | bfa71abf3ff63ac54d7bda643ab2c19325f05d51 /src/components/Dialog/index.web.tsx | |
parent | c12fd4482e9bbccf725c662a26d3dccd12c8ee83 (diff) | |
download | voidsky-8dcf1825ec3fa3a98ae8d9974434489b9b66a69b.tar.zst |
Web: fix Edit Profile discard warning when pressing backdrop (#8824)
* Web: fix Edit Profile discard warning * cleanup imports
Diffstat (limited to 'src/components/Dialog/index.web.tsx')
-rw-r--r-- | src/components/Dialog/index.web.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 1417e9e91..7e10dfadc 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -2,6 +2,7 @@ import React, {useImperativeHandle} from 'react' import { FlatList, type FlatListProps, + type GestureResponderEvent, type StyleProp, TouchableWithoutFeedback, View, @@ -75,9 +76,12 @@ export function Outer({ [control.id, onClose, setDialogIsOpen], ) - const handleBackgroundPress = React.useCallback(async () => { - close() - }, [close]) + const handleBackgroundPress = React.useCallback( + async (e: GestureResponderEvent) => { + webOptions?.onBackgroundPress ? webOptions.onBackgroundPress(e) : close() + }, + [webOptions, close], + ) useImperativeHandle( control.ref, |