mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: a11y polish (#9259)
This commit is contained in:
23
apps/toolbox/src/pages/sample-modal.ts
Normal file
23
apps/toolbox/src/pages/sample-modal.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Page, ShownModallyData, Observable } from '@nativescript/core';
|
||||
|
||||
let page: Page;
|
||||
let closeCallback: Function;
|
||||
export function onShownModally(args: ShownModallyData) {
|
||||
page = <Page>args.object;
|
||||
page.bindingContext = new SampleModal();
|
||||
closeCallback = args.closeCallback;
|
||||
|
||||
if (args.context) {
|
||||
args.context.shownModally = true;
|
||||
}
|
||||
}
|
||||
|
||||
export class SampleModal extends Observable {
|
||||
close() {
|
||||
// TODO: a11y
|
||||
// if (global.isIOS) {
|
||||
// (<UIViewController>page.ios).view.accessibilityPerformEscape();
|
||||
// }
|
||||
closeCallback();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user