This is done by guarding the `on_hashchange` evant handler with the `clear_uncommitted_changes` function. Note that the url has already changed when we are in this handler, so we make sure to restore the old url when the user chose to continue its edition.