maxs15 / react-native-modalbox

A <Modal/> component for react-native
MIT License
2.9k stars 506 forks source link

Safe view area for modal view #279

Open hyhypepe opened 5 years ago

hyhypepe commented 5 years ago

I can't wrap Modal component by SafeAreaView to handle layout properly in iOS device. Have anyone ever faced this issue? Please support me. Thank you

steveyu2 commented 5 years ago

+1

riosjr commented 4 years ago

any news on that?

lklima commented 4 years ago

I fixed this issue with https://github.com/miyabi/react-native-safe-area library, setting bottom on modal style:

`SafeArea.getSafeAreaInsetsForRootView().then((result) => {
    const bottom = Platform.OS === 'ios' ? result.safeAreaInsets.bottom : 0;
    this.setState({ bottom });
  });`

and:

     `<Modal
        style={[styles.modalContainer, { bottom }]}
        isOpen={isOpen}
        position="bottom"
        backButtonClose={false}
        backdrop={false}
        swipeToClose={false}
      >
        <Text style={styles.modalText}>
          {sdText}, {userName}
        </Text>`

Hope this helps!

Captura de Tela 2020-01-26 às 11 42 59