-
Couldn't load subscription status.
- Fork 150
Open
Description
if focusOnOpen is false, the user can not navigate the MenuItem by pressing the arrow up or down key
if focusOnOpen is true, the user can navigate the MenuItem by pressing the arrow up or down key
function Example() {
const [open, setOpen] = React.useState(false);
return (
<MenuSurfaceAnchor>
<Menu
open={open}
onSelect={(evt) => console.log(evt.detail.index)}
onClose={() => setOpen(false)}
focusOnOpen={false}
>
<MenuItem>Cookies</MenuItem>
<MenuItem>Pizza</MenuItem>
{/** MenuItem is just a ListItem, so you can intermingle other List components */}
<ListDivider />
<MenuItem>Icecream</MenuItem>
</Menu>
<Button raised onClick={() => setOpen(!open)}>
Menu
</Button>
</MenuSurfaceAnchor>
);
}
Metadata
Metadata
Assignees
Labels
No labels