-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.2.0
-
MOODLE_402_STABLE
In the current implementation, the can-leave guard is ignoring all errors and assuming that the navigation was cancelled. This may arise from the fact that the CoreDomUtils.showConfirm() method, which is used in most implementations, throws an error instead of returning false. This could cause some problems if an error happens after showing users' the confirmation dialog, because they may accept leaving the screen but some other error cancels the navigation and they stay on the page.
When looking at this, we'll also want to look at other uses of the CanLeave interface (for example, in the CoreNavigator class).