framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.06k stars 3.23k forks source link

Unable to navigate back a second time with async route when on same page #4111

Closed peitschie closed 1 year ago

peitschie commented 1 year ago

Describe the bug

Navigating back to current URL a second time with an async route leaves allowPageChange incorrectly set to false after routing has completed.

Related to #2200. The fix for #2200 in https://github.com/framework7io/framework7/commit/83abadd66d0d003fdcaf0857d70f37ee8d9e6447 only addresses navigate, and missed applying the same fix on back

To Reproduce

Reproduction app at https://codesandbox.io/p/sandbox/eager-kepler-ozg9yr

Steps to reproduce the behavior:

  1. Starting on an async route
  2. Navigate forward ("Click me first" in sandbox)
  3. After arriving at the second page, navigate back to the original url exactly ("Demonstrate bug" in sandbox)
  4. Once arriving back on the original route, try and navigate back to the same url again (it MUST be an async route to show the defect)
  5. Observe that now allowPageChange remains false

Expected behavior

At step 5, allowPageChange should return to true once the back command completes without updating the page.

Actual Behavior

At step 5, allowPageChange incorrectly remains false once the back command completes without updating the page.