File tree Expand file tree Collapse file tree
Open diff view settings
apps/automated/src/ui/page Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change @@ -5,6 +5,23 @@ import { addLabelToPage } from './page-tests-common';
55
66export * from './page-tests-common' ;
77
8+ export function test_enableSwipeBackNavigation_updates_the_native_gesture ( ) {
9+ const page = new Page ( ) ;
10+ addLabelToPage ( page ) ;
11+ helper . navigateWithHistory ( ( ) => page ) ;
12+
13+ const gesture = page . ios . navigationController . interactivePopGestureRecognizer ;
14+ TKUnit . assertTrue ( gesture . enabled , 'Swipe-back gesture should initially be enabled.' ) ;
15+
16+ page . enableSwipeBackNavigation = false ;
17+ TKUnit . assertFalse ( gesture . enabled , 'Swipe-back gesture should be disabled after updating the Page property.' ) ;
18+
19+ page . enableSwipeBackNavigation = true ;
20+ TKUnit . assertTrue ( gesture . enabled , 'Swipe-back gesture should be re-enabled after updating the Page property.' ) ;
21+
22+ helper . goBack ( ) ;
23+ }
24+
825export function test_NavigateToNewPage_InnerControl ( ) {
926 var testPage : Page ;
1027 var pageFactory = function ( ) : Page {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { isAccessibilityServiceEnabled } from '../../application';
22import type { Frame } from '../frame' ;
33import { BackstackEntry , NavigationType } from '../frame/frame-interfaces' ;
44import { View , IOSHelper } from '../core/view' ;
5- import { PageBase , actionBarHiddenProperty } from './page-common' ;
5+ import { PageBase , actionBarHiddenProperty , enableSwipeBackNavigationProperty } from './page-common' ;
66
77import { profile } from '../../profiling' ;
88import { layout } from '../../utils/layout-helper' ;
@@ -575,8 +575,6 @@ export class Page extends PageBase {
575575 }
576576
577577 [ actionBarHiddenProperty . setNative ] ( value : boolean ) {
578- this . _updateEnableSwipeBackNavigation ( value ) ;
579-
580578 // Invalidate all inner controller.
581579 invalidateTopmostController ( this . viewController ) ;
582580
@@ -587,6 +585,10 @@ export class Page extends PageBase {
587585 }
588586 }
589587
588+ [ enableSwipeBackNavigationProperty . setNative ] ( value : boolean ) {
589+ this . _updateEnableSwipeBackNavigation ( value ) ;
590+ }
591+
590592 public accessibilityScreenChanged ( refocus = false ) : void {
591593 if ( ! isAccessibilityServiceEnabled ( ) ) {
592594 return ;
You can’t perform that action at this time.
0 commit comments