MCPcopy Create free account
hub / github.com/adobe/react-spectrum / navigation

Function navigation

perf/drivers.mjs:70–94  ·  view source on GitHub ↗
(fixture)

Source from the content-addressed store, hash-verified

68
69// Virtualized popups render only the visible options, so they cannot check the count.
70function navigation(fixture) {
71 let combobox = fixture.startsWith('combobox');
72 let virtualized = fixture.endsWith('-virtual');
73 let conditions = size => [
74 ...(virtualized ? [] : [condition('[role="option"]', {count: size})]),
75 condition('[role="option"][data-focused]', {
76 count: 1,
77 attribute: 'data-record',
78 value: 'item-1'
79 }),
80 combobox
81 ? condition('#combo-input', {focused: true, activeDescendant: option('item-1')})
82 : condition(option('item-1'), {focused: true})
83 ];
84 return {
85 keyboard: {
86 prepare: ({page}) => openPopup(page, fixture, () => page.keyboard.press('Home')),
87 spec: size => press('ArrowDown', combobox ? '#combo-input' : '.list', conditions(size))
88 },
89 hover: {
90 prepare: ({page}) => openPopup(page, fixture, () => page.locator(option('item-0')).hover()),
91 spec: size => ({event: 'pointerover', target: option('item-1'), conditions: conditions(size)})
92 }
93 };
94}
95
96async function openComboFilter({page}) {
97 await page.locator('#combo-open').click();

Callers 1

drivers.mjsFile · 0.85

Calls 4

openPopupFunction · 0.85
pressFunction · 0.85
conditionsFunction · 0.85
optionFunction · 0.85

Tested by

no test coverage detected