MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / onShownModally

Function onShownModally

apps/automated/src/ui/page/modal-tab-root.ts:4–19  ·  view source on GitHub ↗
(args: ShownModallyData)

Source from the content-addressed store, hash-verified

2import * as TKUnit from '../../tk-unit';
3
4export function onShownModally(args: ShownModallyData) {
5 const tabView = <TabView>args.object;
6 TKUnit.assertNotNull(tabView);
7 if (args.context) {
8 args.context.shownModally = true;
9 }
10
11 const hostFrame = Frame._stack()[0];
12 TKUnit.assertNotNull(hostFrame, 'Host frame should not be null');
13 TKUnit.assertEqual(hostFrame.currentPage.modal, tabView, 'hostFrame.currentPage.modal should be equal to the tabView instance on tabView.shownModally event handler.');
14
15 // shownModally raised after page.NavigatedTo on iOS
16 if (__APPLE__) {
17 args.closeCallback('return value');
18 }
19}

Callers

nothing calls this directly

Calls 2

_stackMethod · 0.80
closeCallbackMethod · 0.45

Tested by

no test coverage detected