Hi,
i ionic 4 tabs using. Hardware back button listener on the OtherTabPage. HomeTabPage and OtherTabPage icons remain selected when the hardwareBackButton function runs. but there is no problem running onClick function.
<ion-button (click)="onClick()">
Go Home
</ion-button>
export class OtherTabPage {
constructor(private platform: Platform) {
this.hardwareBackButton();
}
hardwareBackButton() {
this.platform.backButton.subscribe(async () => {
this.router.navigateByUrl('/'); // Go to home
});
}
onClick() {
this.router.navigateByUrl('/'); // Go to home
}
}