[v5] On web the bottom sheet modal only works once
Bug
When creating the modal and loading it will work, when you close or dismiss the modal it will set the transform Y. If you try to open the modal again it will not open, and the transform will still be incorrect.
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 5.0.0-alpha4 |
| react-native | 0.72.4 |
| react-native-reanimated | 3.3.0 |
| react-native-gesture-handler | 2.12.0 |
Steps To Reproduce
- Create bottom sheet modal
- Open app in web
- Click button to open modal
- Close modal
- Click button to open modal it will not show
Describe what you expected to happen:
- Show the modal again
Reproducible sample code
Hard to do because there is no web in the snack, will try to make one later
I'm using @gorhom/[email protected] with Solito (Next.js), I found that sometimes transform value be broken
The first time the page renders it fine, leave the page and come back, the bottom sheet will not be visible
after investigation I found that transform value will start with double the size of screen height, so when it expand it will still be outside or visible screen
I'm still trying to find a solution for it, not sure if it's the exact same issue as you have but hope it leads you to something.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Not stale, I'm experiencing the same issue.
i'm experiencing the same issue too but in enviroment mobile, some solution? in my case the bottomsheet don't open, in some times open, but 2th time don't work
Will look into it today!
@TNAJanssen @MustafaAlsihati @viljark i tried to repo the issue on latest release alpha6, but i can not reproduce it ? could someone provide a repo sample code please.
https://github.com/gorhom/react-native-bottom-sheet/assets/4061838/0c8b8123-2a61-44e9-921e-8613f154e44b
i think that it's same bug, code demo:
const Mapa = ({ }) => {
const [open, setOpen] = useState(false);
let snapPoints = useMemo(() => ['5%', '60%'], []);
// callbacks
const handleSheetChanges = useCallback((index) => {
console.log(index)
}, []);
return (
<>
<Button onPress={() => setOpen(true)}>click</Button>
{open && (
<BottomSheet
ref={bottomSheetRef}
index={1}
snapPoints={snapPoints}
onChange={handleSheetChanges}
enablePanDownToClose={true}
>
<BottomSheetScrollView><Text>Hello world</BottomSheetScrollView>
</BottomSheet>
)
</>
)
}
"@gorhom/bottom-sheet": "^4", "react-native-gesture-handler": "~2.12.0", "react-native-reanimated": "~3.3.0", "react-native": "0.72.3",