Skip to content

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.

2 participants