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

Ensure disabled="false" is not incorrectly passed to the underlying DOM Node #2138

Merged
merged 4 commits into from
Jan 2, 2023

Conversation

RobinMalfait
Copy link
Collaborator

This PR fixes an issue where disabled="false" was incorrectly forwarded to the underlying DOM
node, which could break some projects if some CSS sets [disabled] { } because this also matches
disabled="false"

Fixes: #2134

We use the `aria-disabled` instead so that you can still style it and
that assistive techonology can read the disabled state. If it has the
`disabled` prop itself, then often you can't interact with it at all.

We also default to `disabled = false`, which means that the default
behaviour was a `<element disabled="false">` in the DOM. If you then
have CSS like `[disabled] { opacity: 0.8; }` then this also applies to
the elements with `disabled="false"`.

Fixes: #2134
@vercel
Copy link

vercel bot commented Jan 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 2, 2023 at 3:51PM (UTC)
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 2, 2023 at 3:51PM (UTC)

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.

Vue: MenuItem adds disabled="false" by default, triggering disabled CSS styles
1 participant