fix(list-box): set aria-disabled if disabled (#2125)

This commit is contained in:
Eric Liu 2025-03-19 12:43:05 -07:00
commit 96d45e9b81
2 changed files with 2 additions and 0 deletions

View file

@ -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

View file

@ -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("");