3 ms·
I wish this would be the case. The button will not be focusable, so we need to add tabindex="0". A disabled div with role="button" is not handled as disabled, s
by darekkay 6y ago
I wish this would be the case. The button will not be focusable, so we need to add tabindex="0". A disabled div with role="button" is not handled as disabled, so we need to take care of that. Keyboard space/enter will not be triggered on "click" event, unlike real buttons, hence excluding keyboard users. You can check my playground [1] - I'm using it to demo why one should prefer native over custom components.
[1] https://darekkay.github.io/presentations/accessible-web/resources/custom-component.html https://darekkay.github.io/presentations/accessible-web/reso...