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

Function SelectionStatic

packages/@react-spectrum/s2/test/Menu.test.tsx:63–84  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

61];
62
63function SelectionStatic(props) {
64 let {selectionMode = 'single'} = props;
65 let [selected, setSelected] = React.useState<Selection>(new Set());
66 return (
67 <MenuTrigger>
68 <Button variant="primary">Menu Button</Button>
69 <Menu
70 aria-label="Test"
71 selectionMode={selectionMode}
72 selectedKeys={selected}
73 onSelectionChange={setSelected}>
74 <MenuSection>
75 <Header>Heading 1</Header>
76 <MenuItem id="foo">Foo</MenuItem>
77 <MenuItem id="bar">Bar</MenuItem>
78 <MenuItem id="baz">Baz</MenuItem>
79 <MenuItem id="fizz">Fizz</MenuItem>
80 </MenuSection>
81 </Menu>
82 </MenuTrigger>
83 );
84}
85
86describe('Menu unavailable', () => {
87 let user;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected