3 ms·
It’s weird to see so many UX articles on the front page of HN that are just wrong. Disabling buttons that are functionally no-ops is the semantically correct t
by flappyeagle 3y ago
It’s weird to see so many UX articles on the front page of HN that are just wrong.
Disabling buttons that are functionally no-ops is the semantically correct thing to do.
- nosefurhairdo 3y agoIt's not a UX article, it's an accessibility article. Disabling the button can be confusing for users relying on screen readers, and if it's the only way the "submission pending" state is communicated to the user then it's plainly non-conforming with WCAG.
- agloe_dreams 3y agoSeeing as most forms work this way...shouldn't the screen reader understand this? You are in a form, the button is the submit button. It went to disabled after form submit. Save that ref, fake the tab index so tabbing takes you to the next item, if the button becomes enabled again, highlight it. This feels like an easy win.
- jeroenhd 3y agoThe browsers and/or the screen readers are the problem here. Resetting focus to the document level doesn't make sense, and screen readers should just be able to read disabled buttons. The proposed solution (hacking together a pseudo-disabled button) will only lead to more ugly buttons that don't seem to do anything. Setting the transparency on a button does not make it look disabled, nor does it stop the click animation which would suggest the button is still activating something. If you're going to hack around silly browser bugs like these, add a loading spinner with ARIA description "submitting your form" and put it into focus. That way you can disable buttons all you like without resorting to weird workarounds.