Description
The Routing and Navigation sample has a dialog accessible from the Settings screen. The Cancel/OK buttons use Navigator.pop()
to close the dialog and that works
But when the dialog is open and the web browser's back button is pressed, the dialog stays open and the page behind it navigates back. This is wrong.
I'm confident that this is would be highly unexpected UX for any real app--the back button should have the same effect as pop
ing to maintain a consistent UX.
This is a serious problem my team has been unable to solve. We've tried all of the following and none of them seem to trigger for the browser's back button:
WillPopScope
BackButtonListener
backButtonDispatcher.didPopRoute()
window.onBeforeUnload
If we can't listen for the back button and warn the user about unsaved data loss and block the navigation, this is a serious limitation of the platform. How are people solving this? Thanks!