There is no clear way to disable a button
See original GitHub issueI have a form with button and when submitting the form I’ll like to disable all the components because there might be an error return from the server in which can I’ll re-enable the components to allow the user to correct the input and submit it again.
Currently I don’t see any way to disable to button except of removing the onClick which does not seem like the right way.
Expected Behavior
I think it will be better to have the disabled
attribute be settable so we could disable the button.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Enable/Disable Clear button based on the search criteria
Enable/Disable Clear button based on the search criteria · 1 - First the clear button will be disabled · 2 - When the...
Read more >How to disable or enable buttons using Javascript and jQuery
Learn how to enable or disable buttons using javascript and jQuery based on whether the input field is filled or empty.
Read more >Why You Shouldn't Gray Out Disabled Buttons - UX Movement
How should disabled buttons appear when they're inactive? The way most designers indicate an inactive state is by graying out the button.
Read more >Frustrating Design Patterns: Disabled Buttons
As Adam Silver notes in his excellent book “Form Design Patterns”, usually disabled buttons are not focusable and hence users can't reach them ......
Read more >Disabled Buttons in User Interface - Nick Babich
It is still possible to disable a submit button by default for login, shipping, billing, and many other forms when all fields are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I bow before the HOR (higher order reason) that prevents the Button component to have a simple disabled property, but for everyone that isn’t that enlightend in UX philosopy, the following wrapper might come in handy:
Hi @ido-ran, Grommet has a showcase app that uses a pattern for a processing/validating state of a form.
Let us know if this answers your question and if we can close this issue. Thanks!