fix context menu keyboard focus
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -182,6 +182,7 @@ export const BoardEmptySpaceContextMenu = ({ section, refs, children, ...boxProp
|
||||
</Box>
|
||||
<Menu
|
||||
opened={menu !== null}
|
||||
withInitialFocusPlaceholder={false}
|
||||
onChange={(opened) => {
|
||||
if (!opened) closeMenu();
|
||||
}}
|
||||
@@ -194,6 +195,7 @@ export const BoardEmptySpaceContextMenu = ({ section, refs, children, ...boxProp
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown>
|
||||
<Menu.Item
|
||||
data-autofocus
|
||||
leftSection={<IconPlus size={18} />}
|
||||
onClick={() => {
|
||||
const placement = menu?.placement;
|
||||
|
||||
@@ -255,8 +255,6 @@ describe("Board advanced interactions", () => {
|
||||
await expect(grid).toHaveAttribute("aria-label", "Add item here");
|
||||
|
||||
await grid.press("Shift+F10");
|
||||
await expect(addHereMenuItem).toBeVisible();
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await expect(addHereMenuItem).toBeFocused();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.getByRole("dialog").filter({ hasText: "Choose item to add" })).toBeVisible();
|
||||
|
||||
Reference in new issue
Block a user