MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / getHasNaturalTabNavigation

Function getHasNaturalTabNavigation

core/src/utils/test/press-keys.ts:61–76  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

59 * in the DOM when the tab key is pressed.
60 */
61const getHasNaturalTabNavigation = async (page: Page) => {
62 if (!isAppleOS() || !isWebkit(page)) {
63 return true;
64 }
65 if (browserCache.has(page.context().browser()!)) {
66 return browserCache.get(page.context().browser()!);
67 }
68 const testPage = await page.context().newPage();
69 await testPage.setContent(`<button>1</button><button>2</button>`);
70 await testPage.getByText('1').focus();
71 await testPage.keyboard.press('Tab');
72 const featureDetected = await testPage.getByText('2').evaluate((node) => node === document.activeElement);
73 browserCache.set(page.context().browser()!, featureDetected);
74 await testPage.close();
75 return featureDetected;
76};
77
78type Options = {
79 /**

Callers 1

pressKeysFunction · 0.85

Calls 6

isAppleOSFunction · 0.85
isWebkitFunction · 0.85
setMethod · 0.80
getMethod · 0.65
closeMethod · 0.65
setContentMethod · 0.45

Tested by

no test coverage detected