Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Issue #SB-3607 fix: Modified backbutton functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
sudip-mukherjee committed Feb 13, 2019
1 parent aa8fc9a commit ac9e4f7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pages/search/filters/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NavParams, PopoverController, NavController, Events, Platform } from 'i
import { CommonUtilService } from '../../../service/common-util.service';
import * as _ from 'lodash';
import { FilterOptions } from './options/options';
import { IonicApp } from 'ionic-angular';

@Component({
selector: 'page-filter',
Expand All @@ -22,7 +23,8 @@ export class FilterPage {
private navCtrl: NavController,
private events: Events,
private commonUtilService: CommonUtilService,
private platform: Platform
private platform: Platform,
private ionicApp: IonicApp
) {
this.init();
this.handleBackButton();
Expand Down Expand Up @@ -105,7 +107,13 @@ export class FilterPage {
*/
handleBackButton() {
this.unregisterBackButton = this.platform.registerBackButtonAction(() => {
this.navCtrl.pop();
const activePortal = this.ionicApp._modalPortal.getActive() ||
this.ionicApp._toastPortal.getActive() || this.ionicApp._overlayPortal.getActive();
if (activePortal) {
activePortal.dismiss();
} else if (this.navCtrl.canGoBack()) {
this.navCtrl.pop();
}
this.unregisterBackButton();
}, 11);
}
Expand Down

0 comments on commit ac9e4f7

Please sign in to comment.