- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 641
[New] no-disabled rule #830
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
c95e07b
              aa41427
              1d89958
              b2cfb4b
              b95ebd2
              167c235
              a556263
              23d6ef9
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -3,8 +3,7 @@ | |
| Rule that `disabled` prop should be cautioned on elements. Disabling interactive elements removes the element from the accessibility tree. Consider using `aria-disabled`. | ||
|  | ||
| ## Rule details | ||
|  | ||
| Warns usage of `disabled` property. | ||
| The general consensus is that `disabled` should be used with specific intent. It goes against intuition since `disabled` is a native HTML attribute, which disables. However, from a usability stand-point it is not a good UX for screen readers: It removes the element from the a11y tree, and may omit critical information. It is best to use `aria-disabled` and add the additional JS logic to "disable" the element. | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to be a bit more prescriptive here with this text. Apologies for the heavy-handed editing: "The  For this reason, we recommend that authors not use the  | ||
|  | ||
| ### Succeed | ||
| ```jsx | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.