Skip to content

Conversation

@kensternberg-authentik
Copy link
Collaborator

What

While testing, I discovered that the disabled feature was not working as expected.

The visuals weren’t being applied correctly, which required some CSS work to correct. This also fixed the issue where the pointer events weren’t being disabled at the same time. There were two issues: the concrete controls were being applied to the wrong component, and the CSS cascade was being read in the wrong order. disabled takes priority over virtually everything else, so it has to go at the bottom of the CSS field.

After that, I applied the ARIA rules for disabled links, which specifies that “to communicate a link as ‘disabled,’ remove the href attribute and style accordingly.” That, in turn, caused the underline to go away, which was not desired, so when the displayed part is a “disabled anchor,” I added CSS to force the underline to return.

I have added a story to show that the disabled button and disabled link work as expected.

# What

While testing, I discovered that the `disabled` feature was not working as expected.

The visuals weren’t being applied correctly, which required some CSS work to correct. This also fixed the issue where the pointer events weren’t being disabled at the same time. There were two issues: the concrete controls were being applied to the wrong component, and the CSS cascade was being read in the wrong order. `disabled` takes priority over virtually everything else, so it has to go at the bottom of the CSS field.

After that, I applied [the ARIA rules for disabled links](https://www.w3.org/TR/html-aria/#example-communicate-a-disabled-link-with-aria), which specifies that “to communicate a link as ‘disabled,’ remove the `href` attribute and style accordingly.” That, in turn, caused the underline to go away, which was not desired, so when the displayed part is a “disabled anchor,” I added CSS to force the underline to return.

I have added a story to show that the disabled button and disabled link work as expected.
@netlify
Copy link

netlify bot commented Dec 31, 2025

Deploy Preview for authentik-elements-storybook ready!

Name Link
🔨 Latest commit 9bd3235
🔍 Latest deploy log https://app.netlify.com/projects/authentik-elements-storybook/deploys/695561e46be512000894e75e
😎 Deploy Preview https://deploy-preview-49--authentik-elements-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kensternberg-authentik kensternberg-authentik marked this pull request as ready for review December 31, 2025 17:48
@kensternberg-authentik kensternberg-authentik merged commit 9bd3235 into main Jan 8, 2026
4 checks passed
@kensternberg-authentik kensternberg-authentik deleted the bug/ak-button/bad-disabled-state branch January 8, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants