fix: reset isclosing variable when position changed

This commit is contained in:
Mo Gorhom
2021-03-19 22:24:06 +00:00
parent 3abe59909d
commit 5302e20dd4

View File

@@ -338,10 +338,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
if (_providedOnChange) {
_providedOnChange(index);
}
if (isClosing.current && (index === 0 || index === -1)) {
isClosing.current = false;
}
});
const handleSettingScrollableRef = useCallback(
(scrollableRef: ScrollableRef) => {
@@ -539,6 +535,11 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
call([currentPosition], args => {
const currentPositionIndex = snapPoints.indexOf(args[0]);
/**
* reset is closing
*/
isClosing.current = false;
/**
* if animation was interrupted, we ignore the change.
*/