Skip to content
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

bug: Hardware button not triggering with subscribeWithPriority #18852

Closed
Ketec opened this issue Jul 22, 2019 · 2 comments
Closed

bug: Hardware button not triggering with subscribeWithPriority #18852

Ketec opened this issue Jul 22, 2019 · 2 comments
Labels

Comments

@Ketec
Copy link

Ketec commented Jul 22, 2019

this.platform.backButton.subscribeWithPriority(100, () => {
      console.log('#triggered');
})

In any page. Even app.component does not trigger.
Looking at the source, ionic uses 0 and everything higher should overwrite it.

Could easily get this even in using ionic tabs template and adding the code above to the constructor.
It also does it's own stack navigation instead, and does not close the app (instead routes to / or index.php and causes app to reload).

Is the subscription lost somewhere and the handlers in hardware-back-button.ts only got ionic handle?

Tested on Android 9. Cordova event does trigger.

Latest ionic angular and core.

When debugging, I never hit the ev.register(priority, callback); line.

looking at the code it seems to be "ev.detail.register" not "ev.register"

@ionitron-bot ionitron-bot bot added the triage label Jul 22, 2019
@liamdebeasi
Copy link
Contributor

Thanks for the issue! I am going to close this as a duplicate of #17824.

@ionitron-bot
Copy link

ionitron-bot bot commented Aug 21, 2019

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants