palantir/blueprint
Ver no GitHubClose popover when menu item is selected via enter / space key
Open
#4.903 aberto em 14 de set. de 2021
Domain: accessibilityP2Package: corePackage: popover2Type: enhancementhelp wanted
Métricas do repositório
- Stars
- (20.263 stars)
- Métricas de merge de PR
- (Mesclagem média 43d 10h) (27 fundiu PRs em 30d)
Description
Environment
- Package version(s): core 3.49.1 / popover2 0.11.4
- Browser and OS versions:
Feature request
When a menu item inside a popover is clicked, the popover gets closed automatically. For accessibility reasons, menu items also need to be selectable via keyboard (pressing the enter or space key) - in this case the popover should also close automatically.
Examples
Sandbox: https://codesandbox.io/s/blueprint-sandbox-forked-co638?file=/src/index.tsx
In the below example, if the key used on the menu item was enter or space, the popover should close.
<Popover2
content={
<Menu>
<MenuItem
onClick={() => console.info("click")}
onKeyUp={() => console.info("Key up")}
tabIndex={0}
text="Test"
/>
</Menu>
}
>
<Button>Click me</Button>
</Popover2>