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

Function ActivityListBox

packages/react-aria-components/test/ListBox.test.js:2366–2388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2364 if (React.version.startsWith('19')) {
2365 it('supports Activity', async () => {
2366 function ActivityListBox() {
2367 let [mode, setMode] = React.useState('hidden');
2368
2369 return (
2370 <>
2371 <Button onPress={() => setMode(mode === 'hidden' ? 'visible' : 'hidden')}>
2372 Set {mode === 'hidden' ? 'visible' : 'hidden'}
2373 </Button>
2374
2375 <React.Activity mode={mode}>
2376 <p>List should be visible</p>
2377
2378 <ListBox aria-label="Activity Listbox">
2379 <ListBoxItem>Item 1</ListBoxItem>
2380 <ListBoxItem>Item 2</ListBoxItem>
2381 <ListBoxItem>Item 3</ListBoxItem>
2382 <ListBoxItem>Item 4</ListBoxItem>
2383 <ListBoxItem>Item 5</ListBoxItem>
2384 </ListBox>
2385 </React.Activity>
2386 </>
2387 );
2388 }
2389
2390 let {getAllByRole, getByRole, queryAllByRole} = render(<ActivityListBox />);
2391 let button = getByRole('button');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected