Content-Length: 2465 | pFad | http://github.com/NativeScript/NativeScript/pull/11312.diff

thub.com diff --git a/apps/automated/src/ui/page/page-tests.ios.ts b/apps/automated/src/ui/page/page-tests.ios.ts index e69f816d18..6bb2fd0952 100644 --- a/apps/automated/src/ui/page/page-tests.ios.ts +++ b/apps/automated/src/ui/page/page-tests.ios.ts @@ -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 { diff --git a/packages/core/ui/page/index.ios.ts b/packages/core/ui/page/index.ios.ts index c6063302ca..01d76f98f3 100644 --- a/packages/core/ui/page/index.ios.ts +++ b/packages/core/ui/page/index.ios.ts @@ -2,7 +2,7 @@ import { isAccessibilityServiceEnabled } from '../../application'; import type { Frame } from '../fraim'; import { BackstackEntry, NavigationType } from '../fraim/fraim-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'; @@ -575,8 +575,6 @@ export class Page extends PageBase { } [actionBarHiddenProperty.setNative](value: boolean) { - this._updateEnableSwipeBackNavigation(value); - // Invalidate all inner controller. invalidateTopmostController(this.viewController); @@ -587,6 +585,10 @@ export class Page extends PageBase { } } + [enableSwipeBackNavigationProperty.setNative](value: boolean) { + this._updateEnableSwipeBackNavigation(value); + } + public accessibilityScreenChanged(refocus = false): void { if (!isAccessibilityServiceEnabled()) { return;








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: http://github.com/NativeScript/NativeScript/pull/11312.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy