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

Fix to-be-disabled reaction on disabled="false" #490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JakubGIT
Copy link

@JakubGIT JakubGIT commented Nov 24, 2022

What:

Why:

How:

  • by adding an additional check element.attributes.disabled.value !== 'false'

Checklist:

  • Documentation N/A
  • Tests
  • Updated Type Definitions N/A
  • Ready to be merged

@pseudogram
Copy link

pseudogram commented May 5, 2023

I was going to give this a +1 then I read the docs for the HTML attribute 'disabled'.

A note for those to come:

If you are writing semantic HTML you should not add the attribute disabled if a button is enabled. And there is no such thing as disabled="false" because the attribute has no value.

Reading the double negative probably makes you think, "Something's up?" 🤔

In JSX you should be passing a boolean value to the disabled attribute (not a string). React will handle it the boolean and render the attribute accordingly.

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.

None yet

2 participants