mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Re-apply #2125 (reverted in #2130) to preserve `disabled` attribute. Carbon styles depend on the `[disabled]` attribute. However, the `disabled` attribute is not valid markup when applied to `div role="option"`. This PR preserves the existing `disabled` attribute while also setting `aria-disabled` to maintain accessibility.
This commit is contained in:
parent
43511e09ec
commit
9b61af0306
2 changed files with 2 additions and 0 deletions
|
@ -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