Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/automated/src/ui/page/page-tests.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ import { addLabelToPage } from './page-tests-common';

export * from './page-tests-common';

export function test_enableSwipeBackNavigation_updates_the_native_gesture() {
const page = new Page();
addLabelToPage(page);
helper.navigateWithHistory(() => page);

const gesture = page.ios.navigationController.interactivePopGestureRecognizer;
TKUnit.assertTrue(gesture.enabled, 'Swipe-back gesture should initially be enabled.');

page.enableSwipeBackNavigation = false;
TKUnit.assertFalse(gesture.enabled, 'Swipe-back gesture should be disabled after updating the Page property.');

page.enableSwipeBackNavigation = true;
TKUnit.assertTrue(gesture.enabled, 'Swipe-back gesture should be re-enabled after updating the Page property.');

helper.goBack();
}

export function test_NavigateToNewPage_InnerControl() {
var testPage: Page;
var pageFactory = function (): Page {
Expand Down
8 changes: 5 additions & 3 deletions packages/core/ui/page/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isAccessibilityServiceEnabled } from '../../application';
import type { Frame } from '../frame';
import { BackstackEntry, NavigationType } from '../frame/frame-interfaces';
import { View, IOSHelper } from '../core/view';
import { PageBase, actionBarHiddenProperty } from './page-common';
import { PageBase, actionBarHiddenProperty, enableSwipeBackNavigationProperty } from './page-common';

import { profile } from '../../profiling';
import { layout } from '../../utils/layout-helper';
Expand Down Expand Up @@ -575,8 +575,6 @@ export class Page extends PageBase {
}

[actionBarHiddenProperty.setNative](value: boolean) {
this._updateEnableSwipeBackNavigation(value);

// Invalidate all inner controller.
invalidateTopmostController(this.viewController);

Expand All @@ -587,6 +585,10 @@ export class Page extends PageBase {
}
}

[enableSwipeBackNavigationProperty.setNative](value: boolean) {
this._updateEnableSwipeBackNavigation(value);
}

public accessibilityScreenChanged(refocus = false): void {
if (!isAccessibilityServiceEnabled()) {
return;
Expand Down
Loading