react-native-dialog-component
react-native-dialog-component copied to clipboard
Error layout when use DialogManager.dismiss.
When use DialogManager.dismiss(), dialog width expand to fullscreen then dismiss
Any workarounds on that? If I have time in the next few days I'll take a look and find what is the difference between calling dismiss on a DialogManager and tapping outside of dialog (which doesn't reproduce an issue for me).
The issue is only reproducible if you create a dialog via DialogManager as it uses react-native-root-siblings to draw a dialog and can't properly update its props.
The workaround is to use the DialogComponent. Note that is should be placed in your top-level element to be rendered correctly, in case you're using react-navigation that would be your screen.
For anyone having this problem, close your dialog using DialogManager.currentDialog.destroy()
Disclaimer: This will close the dialog without ANY animation.
For me, using DialogManager.currentDialog.destroy() indeed fixed the animation issue, but created a new problem - a warning about changing a state of a non-mounted component, and also this preventing Back on Android from working correctly.
It appears that using dialogAnimation : new ScaleAnimation(),
in the config fixes the issue.