3 ms·
The 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
by jeroenhd 3y ago
The 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.