I am using a modal with a web block inside, and the ToggleModal action to open/close the modal. However, whenever I click the link that should close the modal, it loads for about 10-20 seconds before the modal actually closes. I understand that it should load longer when opening the modal because I run a Ajax Refresh for the modal itself (for expressions and web block), but what's weird for me is that it takes long for closing too.

Does ToggleModal reloads the content regardless if the modal is closing?

I attached the screenshot of the action flow for reference.

Hello Katrina, 

No. ToggleModal just make it visible. It should me immediate. 

About the refresh, avoid refreshing the nodal itself. Refresh just its content. 

Can you give us an example (working module) showing this behaviour? 


Hi Eduardo,

Thanks for your reply.

My modal contains: (1) a carousel that loads base64 images, (2) a balloon that displays notes of each image only when triggered, and (3) a web block that when triggered, loads the current image for annotation using sketch.js

I can see that the ToggleModal immediately closes the modal only when I have less than 10 images. But when there are 20-30 images, the progress bar above still loads even after the modal is already closed, like there is still something loaded in background. I'm starting to believe this is not modal issue anymore.

I attached a zip file with the clip showing the actual slowness of the action.

Hello Katrina,

I may be wrong, but as far as I know, the toggle modal only shows or hides the modal. It does not process anything or contact the server in any way.

So, I would investigate using the developer tools on chrome (for example), to see what is happening behind the scene when you close the modal...