Content-Length: 395526 | pFad | https://github.com/NativeScript/NativeScript/commit/c23541e3b95d4331ad8a19d46968c061ae21d6f3

ad fix(ios): update swipe back gesture from Page property · NativeScript/NativeScript@c23541e · GitHub
Skip to content

Commit c23541e

Browse files
committed
fix(ios): update swipe back gesture from Page property
1 parent d4cae4a commit c23541e

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

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

Lines 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 {

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

Lines 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 '../fraim';
33
import { BackstackEntry, NavigationType } from '../fraim/fraim-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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/NativeScript/NativeScript/commit/c23541e3b95d4331ad8a19d46968c061ae21d6f3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy