NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Modal not centered vertically when using ScrollView on web

Open armenavanesi opened this issue 3 years ago • 3 comments

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

  1. Create a page that has a ScrollView with enough children in it that it will scroll off page
  2. 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

armenavanesi avatar Feb 09 '23 02:02 armenavanesi

Did you find a workaround for this ?

Snotax avatar Mar 13 '23 09:03 Snotax

The problem is that the parent component of the AlertDialog has a "height:100%" and a "justivy-content:center" attribute.

Snotax avatar Mar 14 '23 09:03 Snotax

@armenavanesi you can add position={"absolute"} height={screen.height} to your AlertDialog to use as a temporary fix!

Snotax avatar Mar 14 '23 09:03 Snotax