Closing modals timeout

Hey,
I’m having this issue: When showing modal dialog shortly after closing one, the new just created modal dialog changes its background color to gray, instead of default white.
I’m currently going around this with: setTimeout(() => {..continue here...}, 700);
Is there any way to just wait for the first modal window to close?`

The code I’m using rn:

progressDialog.close();

    setTimeout(async () => {
        await alert('Alert',
        'Example',
        'File location: ' + rootFolder.nativePath);
    }, 700);`

Could you share the part where you pop two modals consecutively?

@stevekwak

await alert('1',
'First alert shows up how it is supposed to');

await alert('2',
'Second alert shows up with gray background color');

the provided code only has alerts in them. Could you share the part where you use the showModal method?

I mean, it’s not working here either…

I guess my questions is what is that alert function? Can you show what that function looks like?

I’m assuming it’s coming from our plugin toolkit, which provides a simple alert.

But the background color of the dialog isn’t managed by that.

@samodostal, can you confirm that you’re using the plugin toolkit?

Also, try waiting just a little longer and see if that makes a difference. It shouldn’t, but try 1000ms or similar.

Hey, I was abroad. Sorry for not responding.

@kerrishotts , I’m using the plugin toolkit.

Tried waiting 1000ms, the result is the same as with 700ms.

Thanks –

We’ve logged this as a bug on our end, so will be addressing it soon. I’m not sure if which version of XD it will land in just yet.

2 Likes

Hi,

I got the same problem in XD 35.

My work around is to wait approx 550ms before showing the next dialog.

@kerrishotts do you ahve any update on this?

Thanks.