slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
582 stars 128 forks source link

Slow iOS swipe-back gesture with `onPopPage() -> false` gets top-most page stuck on right side of screen #620

Open giorgiogross opened 1 year ago

giorgiogross commented 1 year ago

Describe the bug When I override BeamPage.onPopPage() to block back navigation through iOS back-swipe gesture, the top most screen gets stuck when I slowly drag the screen to the right.

Beamer version: 1.5.5

To Reproduce Steps to reproduce the behavior:

  1. Clone bottom_navigation_example
  2. Override any child-page's onPopPage() and return false.
  3. Run app on iOS (I used the simulator), open the child page, very slowly do the iOS back swipe gesture until the left edge of the child page is around the right third of the screen.
  4. Release the drag, the page gets stuck.

Expected behavior The child page should fully move back into the screen and cover the underlying page.

Screenshots Screen recording Video starts with child page visible. I do a normal pop through the App bar, that works. Then I open the child screen again, and block the navigation (onPopPage() will return false from then on). App bar pop() won't work, small iOS swipe back won't work, but the slow iOS swipe back gets the screen stuck.

Smartphone (please complete the following information):

giorgiogross commented 1 year ago

As a schort follow up: I went on to check how to do custom implementations of RouterDelegate, and it seems that a call to notifyListeners() after aborting the pop() would resolve this issue.