File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -529,12 +529,16 @@ export class Tabs extends Ion implements AfterViewInit {
529529
530530 } else if ( tab . length ( ) > 1 ) {
531531 // if we're a few pages deep, pop to root
532- tab . popToRoot ( ) ;
532+ tab . popToRoot ( ) . catch ( ( ) => {
533+ console . debug ( 'Tabs: pop to root was cancelled' ) ;
534+ } ) ;
533535
534536 } else if ( getComponent ( this . _linker , tab . root ) !== active . component ) {
535537 // Otherwise, if the page we're on is not our real root, reset it to our
536538 // default root type
537- tab . setRoot ( tab . root ) ;
539+ tab . setRoot ( tab . root ) . catch ( ( ) => {
540+ console . debug ( 'Tabs: reset root was cancelled' ) ;
541+ } ) ;
538542 }
539543 }
540544 }
@@ -545,7 +549,7 @@ export class Tabs extends Ion implements AfterViewInit {
545549 */
546550 setTabbarPosition ( top : number , bottom : number ) {
547551 if ( this . _top !== top || this . _bottom !== bottom ) {
548- const tabbarEle = < HTMLElement > this . _tabbar . nativeElement ;
552+ var tabbarEle = < HTMLElement > this . _tabbar . nativeElement ;
549553 tabbarEle . style . top = ( top > - 1 ? top + 'px' : '' ) ;
550554 tabbarEle . style . bottom = ( bottom > - 1 ? bottom + 'px' : '' ) ;
551555 tabbarEle . classList . add ( 'show-tabbar' ) ;
Original file line number Diff line number Diff line change @@ -315,6 +315,11 @@ export class Tab2Page3 {
315315
316316 constructor ( public navCtrl : NavController ) { }
317317
318+ ionViewCanLeave ( ) {
319+ console . log ( 'Tab2Page3, ionViewCanLeave' , false ) ;
320+ return false ;
321+ }
322+
318323 ionViewWillEnter ( ) {
319324 console . log ( 'Tab2Page3, ionViewWillEnter' ) ;
320325 }
Original file line number Diff line number Diff line change 44 < h2 > Tab 2, Page 3</ h2 >
55
66 < p > No Header.</ p >
7+ < p > This page can't be left</ p >
78
8- < p > < button ion-button (click) =" navCtrl.pop() " > Back to Tab 2, Page 2</ button > </ p >
9+ < p > < button ion-button navPop > Back to Tab 2, Page 2</ button > </ p >
910 < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div >
1011 < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div > < div f > </ div >
1112
You can’t perform that action at this time.
0 commit comments