mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(overflow-menu): add aria-controls
to trigger button (#2100)
This commit is contained in:
parent
7256a7987c
commit
b7297d452a
1 changed files with 3 additions and 0 deletions
|
@ -162,6 +162,7 @@
|
|||
onMountAfterUpdate = false;
|
||||
});
|
||||
|
||||
$: menuId = `menu-${id}`;
|
||||
$: ariaLabel = $$props["aria-label"] || "menu";
|
||||
$: if ($items[$currentIndex]) {
|
||||
focusedId.set($items[$currentIndex].id);
|
||||
|
@ -194,6 +195,7 @@
|
|||
aria-haspopup="true"
|
||||
aria-expanded={open}
|
||||
aria-label={ariaLabel}
|
||||
aria-controls={open ? menuId : undefined}
|
||||
{id}
|
||||
class:bx--overflow-menu={true}
|
||||
class:bx--overflow-menu--open={open}
|
||||
|
@ -239,6 +241,7 @@
|
|||
bind:this={menuRef}
|
||||
role="menu"
|
||||
tabindex="-1"
|
||||
id={menuId}
|
||||
aria-label={ariaLabel}
|
||||
data-floating-menu-direction={direction}
|
||||
class:bx--overflow-menu-options={true}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue