dcc.ConfirmDialog is suppressed if Dash is not the active tab

I’m trying to implement a confirm dialog to appear if there was an error in accessing a user uploaded file.

However, I’m starting to run into a problem where if the user leaves the Dash app running to upload the file and was browsing on a different window while it was uploading, the confirm dialog would be suppressed with the following warning mesage:

image

How do I force the confirm dialog to appear regardless of whether the Dash app is the active window at the time of displaying it? This would also be useful in the case the user wants to load up the Dash app on multiple windows in order to upload multiple files at a time.

Thank you!

Hello @hypervalent,

Sounds like you need to query it inside of the JS function itself.

https://stackoverflow.com/questions/1760250/how-to-tell-if-browser-tab-is-active