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