Replies: 1 comment 2 replies
-
Since user regression is browser behavior, all you can do is add beforeunload event to invoke the browser pop-up that prevents page exit by default, and you can't block user regression manually |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I would like to hijack the browser's (or the phone's) back button behavior when the modal is open, so that it would close the modal instead of going to previous page in the browser, this is the intuitive behavior for mobile users.
I am using typescript, nextjs, with the new approuter.
and MUI modal for simplicity:
With the new docs on approuter and useRouter, I am very confused and don't know how to achieve this.
Thank you for the help
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions