mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(list-box): set aria-disabled
if disabled
(#2125)
This commit is contained in:
parent
43511e09ec
commit
96d45e9b81
2 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
class:bx--list-box__menu-item--active={active}
|
||||
class:bx--list-box__menu-item--highlighted={highlighted || active}
|
||||
aria-selected={active}
|
||||
aria-disabled={disabled ? true : undefined}
|
||||
disabled={disabled ? true : undefined}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
|
|
|
@ -166,6 +166,7 @@ describe("ComboBox", () => {
|
|||
const disabledOption = screen.getByText(/Fax/).closest('[role="option"]');
|
||||
assert(disabledOption);
|
||||
expect(disabledOption).toHaveAttribute("disabled", "true");
|
||||
expect(disabledOption).toHaveAttribute("aria-disabled", "true");
|
||||
|
||||
await user.click(disabledOption);
|
||||
expect(screen.getByRole("textbox")).toHaveValue("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue