Prevent page refresh/reload by throwing an alert message #4881
Unanswered
BaccanoMob
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Perhaps related to #2286 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Example Code
Description
I found that
Shows below alert when trying to refresh/reload the page

Note that script in example code works only if you respond to the alert within like 2-3 seconds. If its longer the connection is lost if I leave the alert for too long and the spinner is also frozen when the alert is active (after cancelling it may loop forever sometimes).
Is there a way to allow the ui to function while the pop up shown? or any other way to prevent refresh?
NiceGUI Version
2.19.0
Python Version
3.12.10
Browser
Chrome
Operating System
Linux
Additional Context
Other possible solutions I thought of were (though it is in case I have to allow refresh to take place)
Beta Was this translation helpful? Give feedback.
All reactions