react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Dialogs not showing on IOS

Open Soniachniy opened this issue 6 years ago • 1 comments

simulator IOS: 13.1 Expected behavior - after the first dialog closes the second one appear State changes, but the second dialog don't appear Working fine on Android, only ios issue

` const [isFirstDialogOpen, setIsFirstDialogOpen] = useState(false); const [isSecondDialogOpen, setIsSecondDialogOpen] = useState(false);

 <Dialog
      visible={isFirstDialogOpen}
      onDismiss={() => setIsFirstDialogOpen(false)}
    >
      <Button
        onPress={() => {
          setIsFirstDialogOpen(false);
          setIsSecondDialogOpen(true);
        }}
      >
        <Text>Close</Text>
      </Button>
    </Dialog>

    <Dialog
      visible={isSecondDialogOpen}
      onDismiss={() => setIsSecondDialogOpen(false)}
    >
      <Button onPress={() => setIsSecondDialogOpen(false)}>
        <Text>Close</Text>
      </Button>
    </Dialog>

`

Soniachniy avatar Feb 05 '20 13:02 Soniachniy

Please let us know if the following workaround is good enough:

<Dialog
  visible={isFirstDialogOpen}
  onDismiss={() => this.setIsFirstDialogOpen(false)}
  onModalDismissed={() => this.setIsSecondDialogOpen(true)} // this works only for iOS
>
  <Button
    onPress={() => {
      this.setIsFirstDialogOpen(false);
      if (Constants.isAndroid) {
        this.setIsSecondDialogOpen(true);
      }
    }}
  >
    <Text>Close</Text>
  </Button>
</Dialog>
<Dialog visible={isSecondDialogOpen} onDismiss={() => this.setIsSecondDialogOpen(false)}>
  <Button onPress={() => this.setIsSecondDialogOpen(false)}>
    <Text>Close</Text>
  </Button>
</Dialog>

M-i-k-e-l avatar Feb 06 '20 16:02 M-i-k-e-l