Modal not centered vertically when using ScrollView on web
Description
The modal content gets pushed off screen if there is a ScrollView on the page.
CodeSandbox/Snack link
https://codesandbox.io/s/brave-sound-8yxn0g?file=/src/components/Example.tsx
Steps to reproduce
- Create a page that has a
ScrollViewwith enough children in it that it will scroll off page - Use a modal component
Notice how the Modal content is centered across the whole page (which means it usually gets hidden). Appears to only happen on web.
Expected behaviour: the modal takes up the viewport height, not the page height.
NativeBase Version
3.3.7
Platform
- [ ] Android
- [ ] CRA
- [ ] Expo
- [ ] iOS
- [X] Next
Other Platform
No response
Additional Information
No response
Did you find a workaround for this ?
The problem is that the parent component of the AlertDialog has a "height:100%" and a "justivy-content:center" attribute.
@armenavanesi you can add position={"absolute"} height={screen.height} to your AlertDialog to use as a temporary fix!