Web: fix Edit Profile discard warning when pressing backdrop (#8824)
* Web: fix Edit Profile discard warning * cleanup imports
This commit is contained in:
committed by
GitHub
parent
c12fd4482e
commit
8dcf1825ec
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user