cferdinandi
Re:Just Use a Button
on Friday October 31, 2025 @03:48PM (#45775977)
It's worth noting that VoiceOver is well-known for being a lot more lax than most other screen readers. Other options tend to be a lot more strict around standards and what they'll announce.
Re:Just Use a Button
on Friday October 31, 2025 @03:47PM (#45775960)
I would literally never use <input type="submit|button"> for anything when the <button> element is an option, personally.
Re:Just Use a Button
on Friday October 31, 2025 @03:46PM (#45775951)
That was a big part of "thought leader guy"'s argument in favor of divs, but not the only one.
Re:Just Use a Button
on Friday October 31, 2025 @03:45PM (#45775944)
The most common reason I've seen is whining about having to override default button styles.
Re:Just Use a Button
on Friday October 31, 2025 @03:45PM (#45775937)
Literally absolutely never ever do this.
Re:Just Use a Button
on Friday October 31, 2025 @03:45PM (#45775930)
I probably should have included "if you're building for the frontend you should probably know CSS". Good follow-up piece. Thanks for mentioning it!
Re:Just Use a Button
on Friday October 31, 2025 @03:43PM (#45775922)
It's the default for buttons inside forms, but it's SO trivial to add type="button" than any argument that div's are a better choice because of this should be dismissed as unserious trolling out-of-hand.
Re:Just Use a Button
on Friday October 31, 2025 @03:43PM (#45775913)
No. Objectively no.
It is INFINITELY easier to add type="button" than all of the other shit I mentioned in my article.
Re:Just Use a Button
on Friday October 31, 2025 @01:48PM (#45774711)
Hey, it's me, the original author!
The issue isn't with tabindex=0 specifically, but fucking with tabindex in general. People go down that path, and start putting that shit on everything, like it's Frank's Red Hot.
And in my experience, the same folks who use div's instead of button's are the ones who don't know better and start throwing tabindex around.
"why do you need to listen for events at the document level?"
Not events generally, keydown events specifically, which do not fire on child elements of the document.