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

Rule Proposal: no-disabled-button #297

Open
beefancohen opened this issue Jul 18, 2017 · 2 comments
Open

Rule Proposal: no-disabled-button #297

beefancohen opened this issue Jul 18, 2017 · 2 comments

Comments

@beefancohen
Copy link
Contributor

beefancohen commented Jul 18, 2017

based on this article: https://axesslab.com/disabled-buttons-suck/
wanted to hear people's thoughts on this!

tldr; disabled buttons provide low-contrast non-interactive experiences. in the author's opinion, it is a better UX for both abled and disabled users to enable all buttons and provide clear error messaging when clicked if the user cannot perform the intended action.

Can also add into logic and/or option for proposed button-is-valid #186

@ljharb
Copy link
Member

ljharb commented Jul 18, 2017

The author makes good points, but I don't agree that the suggestion would be an improvement. It sounds like better styling would solve most of the issues; if a button is enabled but shows an alert or similar, there's no declarative way to identify beforehand that the button is semantically disabled.

I think at the least it should be a separate rule; the airbnb config wouldn't ever enable it; and in general I don't think it's a good rule to exist.

@ljharb
Copy link
Member

ljharb commented Nov 11, 2017

Rule about the type added to eslint-plugin-react in jsx-eslint/eslint-plugin-react#1525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants