react-native-dialog-component icon indicating copy to clipboard operation
react-native-dialog-component copied to clipboard

Error layout when use DialogManager.dismiss.

Open HuyHQDev opened this issue 7 years ago • 4 comments

When use DialogManager.dismiss(), dialog width expand to fullscreen then dismiss

HuyHQDev avatar Sep 25 '17 07:09 HuyHQDev

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).

ArsenyYankovsky avatar Dec 21 '17 06:12 ArsenyYankovsky

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.

ArsenyYankovsky avatar Dec 21 '17 07:12 ArsenyYankovsky

For anyone having this problem, close your dialog using DialogManager.currentDialog.destroy()

Disclaimer: This will close the dialog without ANY animation.

krakz999 avatar Sep 06 '18 00:09 krakz999

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.

Orijinn avatar Nov 09 '18 22:11 Orijinn