-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Platform.backButton.subscribeWithPriority doesn't manage priorities #17824
Comments
Hi there, Thanks for opening an issue with us! Can you provide a repository with the code required to reproduce this issue? Thanks! |
Hi, thank you. I provided a repository with the code you need: https://github.com/Takkuz/backButtonIonicIssue On tab2 there is a button to go to tab2-page2, on that page you can change dinamically the priority of the hardware backButton on Android. Using no value or <0 or NaN value removes the subscription. As you can see, without subscription you can use hardware backButton to go to previous page; with priority 0 to 100 it closes popup, as expected, but you doesn't go to previous page; from 101 and above even the popup isn't handled anymore. As far as I can remember, from previous Ionic versions, under priority 100 is handled only if there is any page on the stack because going back on page has priority 100. |
Hi there, Thanks for the repo! I was able to reproduce this issue. I have added this issue to our Hardware Back Button Issue Tracker. We will look into this! Thanks for using Ionic! |
Being able to control your navigation stacks and clicks etc should be the absolute basics. It shouldn't have been out of beta or RC stage yet with this kind of bugs. But now I'm stuck with it, people above are waiting for an explanation for delays and best I can tell them is "ionic has major bugs but they haven't fixed them". |
Thanks for the issue. This has been resolved via #20613, and a fix will be available in an upcoming release of Ionic Framework. Accompanying this fix is a new documentation page dedicated to using the hardware back button in Ionic Framework. These docs will ship alongside the fix. In order to continue to process back button events, you will be able to call the this.platform.backButton.subscribeWithPriority(10, (processNextHandler) => {
console.log('Handler was called!');
processNextHandler();
}); Thanks! |
Hi @liamdebeasi i got this warning when i try using processNextHandler
here how i using it
|
@camengadisaputra Please open a new issue with a code reproduction. Thanks! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Bug Report
Ionic version:
[x] 4.x
Current behavior:
The method
subscribeWithPriority
doesn't manage priority properly: it doesn't matter which priority I've set, it doesn't go back throught the stack. If I set a low priority it hides popups but still doesn't change page.It seems a bug but there's any documentation for that method, so I don't know if I'm using it wrong or it's deprecated without any warning.
Expected behavior:
Like in previous Ionic versions I was expecting to leave back working properly for pages using correct priority level.
Steps to reproduce:
Create a blank app with Android platform, add a second page, and manage
.backButton.subscribeWithPriority()
insideapp.component.ts
Related code:
Ionic info:
The text was updated successfully, but these errors were encountered: