Repository navigation
fix(angular): ignore swipe back with popped stack - #31712
Open
officialasishkumar wants to merge 1 commit into
Open
officialasishkumar wants to merge 1 commit into
officialasishkumar wants to merge 1 commit into
Conversation
Return early from startBackTransition when there is no view to go back to. The swipe gesture checks canGoBack when the pointer goes down, but only starts the transition once the pointer passes the gesture threshold. A navigation finishing in between left a single view in the stack, so reading animationBuilder from the missing entering view threw a TypeError. The throw also left the outlet's gesture marked as in progress, which disabled swipe back until the outlet was recreated. closes ionic-team#31291
|
@officialasishkumar is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #31291
What is the current behavior?
The swipe back gesture on
ion-router-outletcheckscanGoBackwhen the pointer goes down, but only callsstartBackTransitiononce the pointer passes the gesture threshold. If a navigation finishes in between (for examplenavCtrl.back(), a guard redirect orreplaceUrl), only one view is left in the stack andstartBackTransitionthrows:The throw also leaves the outlet's gesture marked as in progress, so swipe back stops working until the outlet is recreated.
What is the new behavior?
startBackTransitiondoes nothing when there is no view to go back to, the same as whencanStartreturnsfalse.ion-router-outletalready handles a gesture that started no transition, so the gesture ends cleanly and later swipes work.history.back(), and then moves the pointer past the threshold. It also checks that a later swipe still goes back.Does this introduce a breaking change?
Other information
I ran this on the
ng22test app in Chromium. Without the fix, the new test fails with theTypeErrorfrom the issue. With the fix, it passes, along withswipe-animated-disabled,swipe-gesture-disabled,tab-lifecycleandlazy/routing.