Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aria-disabled support to button and icon button #5672

Closed
zelliott opened this issue Jul 9, 2024 · 1 comment · Fixed by #5675 · May be fixed by #5673
Closed

Add aria-disabled support to button and icon button #5672

zelliott opened this issue Jul 9, 2024 · 1 comment · Fixed by #5675 · May be fixed by #5673
Assignees

Comments

@zelliott
Copy link
Contributor

zelliott commented Jul 9, 2024

Description

Today, button and icon button only support native [disabled]. They should also support aria-disabled.

The chip component exposes an always-focusable attribute for this:

alwaysFocusable = false;

We could copy that same API, or we could add a new aria-disabled attribute to button and icon button.

Pros for always-focusable

  • Aligns with chip

Pros for aria-disabled

  • Aligns with existing web APIs
  • Aligns with other aria-* APIs exposed on button (e.g. aria-label, aria-haspopup, etc)

I also noticed while looking at chip's implementation that it doesn't set aria-disabled on its inner button if it's disabled and always focusable. It probably should?

?disabled=${this.disabled && !this.alwaysFocusable}

@zelliott
Copy link
Contributor Author

zelliott commented Jul 9, 2024

I think it makes most sense to align with chip for now and expose it as always-focusable. Then we can always change both chip and button to aria-disabled if we want in the future.

copybara-service bot pushed a commit that referenced this issue Jul 10, 2024
Aligns with the `alwaysFocusable` property that's currently provided by chip. Fixes #5672.

PiperOrigin-RevId: 650632329
copybara-service bot pushed a commit that referenced this issue Jul 10, 2024
Aligns with the `alwaysFocusable` property that's currently provided by chip. Fixes #5672.

PiperOrigin-RevId: 650632329
copybara-service bot pushed a commit that referenced this issue Jul 11, 2024
copybara-service bot pushed a commit that referenced this issue Jul 11, 2024
copybara-service bot pushed a commit that referenced this issue Jul 11, 2024
copybara-service bot pushed a commit that referenced this issue Jul 11, 2024
copybara-service bot pushed a commit that referenced this issue Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant