Skip to content

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

New issue

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

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

Already on GitHub? # to your account

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants