Fix bottom sheet backdrop (#6595)

This commit is contained in:
Elias Nahum
2022-08-25 09:07:57 -04:00
committed by GitHub
parent 37e13b81b5
commit f9e37c37af

View File

@@ -64,6 +64,15 @@ const BottomSheet = ({closeButtonId, componentId, initialSnapIndex = 0, renderCo
}
}, []);
const handleCloseEnd = useCallback(() => {
backdropOpacity.value = 0;
setTimeout(close, 250);
}, []);
const handleOpenStart = useCallback(() => {
backdropOpacity.value = 1;
}, []);
useAndroidHardwareBackHandler(componentId, handleClose);
useEffect(() => {
@@ -147,13 +156,8 @@ const BottomSheet = ({closeButtonId, componentId, initialSnapIndex = 0, renderCo
borderRadius={10}
initialSnap={snapPoints.length - 1}
renderContent={renderContainerContent}
onCloseEnd={close}
onCloseStart={() => {
backdropOpacity.value = 0;
}}
onOpenEnd={() => {
backdropOpacity.value = 1;
}}
onCloseEnd={handleCloseEnd}
onOpenStart={handleOpenStart}
enabledBottomInitialAnimation={false}
renderHeader={Indicator}
enabledContentTapInteraction={false}