Hi all,
At the moment it seems that the Android back button is not working as intended as nothing happens when pressing it.
It seems there is no hook, for Vue users, to subscribe to the event the back button throws as opposed to the Angular implementation side (as reported and solved here: https://github.com/ionic-team/ionic/issues/14803)
Is it possible to include this asap?
This is hindering development on an application I am currently creating and of course, hinders the use of Ionic v4 with the Vue framework for other users.
Expected behavior:
Android back button throws event that Vue platform users can subscribe to.
Here is a temporary workaround for Vue.js
import { Plugins } from '@capacitor/core'
Plugins.App.addListener('backButton', function() {
// Your code here
});
Thanks! This has been fixed and will be available in Ionic Vue 0.4.0. We recently released a new Ionic Vue beta built with Vue 3. For more information, please see: https://ionicframework.com/blog/announcing-the-new-ionic-vue-beta/
You will use it like this:
import { useBackButton } from '@ionic/vue';
...
useBackButton(10, (processNextHandler) => {
// do something here
// optionally call processNextHandler to process next handler
});
Hi everyone,
This has been released as part of Ionic Vue 0.4.0. Please open a new GitHub issue for any additional bugs you find. Thanks!
Upgrade:
npm i @ionic/[email protected] @ionic/[email protected]
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.
Most helpful comment
Here is a temporary workaround for Vue.js
import { Plugins } from '@capacitor/core'Plugins.App.addListener('backButton', function() { // Your code here });