Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 36be5f4

Browse filesBrowse files
fix(ios): update swipe back gesture from Page property (#11312)
1 parent ba4615b commit 36be5f4
Copy full SHA for 36be5f4

2 files changed

+22-3Lines changed: 22 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/automated/src/ui/page/page-tests.ios.ts‎

Copy file name to clipboardExpand all lines: apps/automated/src/ui/page/page-tests.ios.ts
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ import { addLabelToPage } from './page-tests-common';
55

66
export * 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+
825
export function test_NavigateToNewPage_InnerControl() {
926
var testPage: Page;
1027
var pageFactory = function (): Page {
Collapse file

‎packages/core/ui/page/index.ios.ts‎

Copy file name to clipboardExpand all lines: packages/core/ui/page/index.ios.ts
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { isAccessibilityServiceEnabled } from '../../application';
22
import type { Frame } from '../frame';
33
import { BackstackEntry, NavigationType } from '../frame/frame-interfaces';
44
import { View, IOSHelper } from '../core/view';
5-
import { PageBase, actionBarHiddenProperty } from './page-common';
5+
import { PageBase, actionBarHiddenProperty, enableSwipeBackNavigationProperty } from './page-common';
66

77
import { profile } from '../../profiling';
88
import { 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;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.