News for hackers. Stuff that matters.
Re:Just Use a Button by serial_dev on Friday October 31, 2025 @05:12PM (#45776764)
So some developers cannot be trusted to figure out that they, in some cases, need to add a single attribute to the button, but they can reimplement a button with all its behavior, feel, look, and accessibility settings starting with a div?
Re:Just Use a Button by Levitz on Friday October 31, 2025 @06:55PM (#45777617)
No, but they can reimplement it in a good enough state for the vast majority of users without getting bothered by default behaviour or styling that might vary per browser.

Which, don't get me wrong, is still a problem, accessibility matters, but if there's a reason as to why something happens, the way to fix it is to actually look at that reason.

Re:Just Use a Button by dpark on Friday October 31, 2025 @11:45PM (#45779095)
A button can easily be styled and it’s definitely easier to fix the one little behavior than to reimplement all the other behaviors that are needed.
Re:Just Use a Button by Levitz on Saturday November 01, 2025 @11:04AM (#45782182)
And yet often this is not what happens. Why?

People don't do stuff poorly on purpose. There's also nobody out there for which button elements are some arcane and obscure thing, we all know they exist, so what is happening?

I'm not arguing for using divs instead of buttons, I'm arguing that if that happens there's a reason for it, and we ought to look at that reason and attempt to deal with it rather than admonishing developers in general.

Re:Just Use a Button by dpark on Saturday November 01, 2025 @11:26AM (#45782396)
Does it happen often? The unintended behavior seems extremely discoverable. “Hey, Google. Why does my button onclick not fire correctly?” “Oh, I need to set this stupid property.”

Would it be nice if this wasn’t necessary? Sure. But browsers aren’t going to break compatibility to fix this quirk.

> we ought to look at that reason and attempt to deal with it

I’m curious how you think we could deal with this aside from education.

Re:Just Use a Button by brazukadev on Sunday November 02, 2025 @09:59AM (#45790792)
It happens often using react because react is full of foot guns
Re:Just Use a Button by brazukadev on Friday October 31, 2025 @05:28PM (#45776899)
React in a nutshell