Hacker News new | past | comments | ask | show | jobs | submit login

These are all terrible from a UX perspective. What in the world were you doing that couldn’t be solved in a more user friendly fashion?



That is a very broad statement. What specifically do you find terrible?

Here is a list of issues I often have with JS-based alternatives that do not exist with alert/confirm/onbeforeunload:

  - the escape key does not close the modal
  - tab focus is not restricted to the modal
  - the modal is not properly announced by screen readers
  - the positions of confirm and cancel buttons differ across sites, leading to misclicks
  - the modal is not or very hard to use on mobile
Building good modal dialogs is hard and much easier done in the browser than on the page. Even <dialog> (if it ever becomes a reality) will not solve all of these issues reliably.

So in a way I agree with you: there might be more user friendly solutions. But the average alternative that people come up with will be worse, not better.


I use confirm() on occasion as a "are you sure you want to delete this?" type protection against misclicks that doesn't involve coding a modal or something.


Same, there's probably hundreds of thousands of business back-end applications that use confirm, as shiny buttons aren't a requirement.

Will they just remove the API (so a JS error) or will it default to "no"?


How cares? I mean, sure if you want to do a shiny applications for consumers, you care. But 99% of the business software doesn't care and wants something that just works.

I use alert, confirm and prompt a lot because it's the simpler way to notify the user, ask for confirmation or ask some input that just works, in all browsers, with vanilla JavaScript, without having to code any CSS (that I hate), or including huge frameworks.

They are used extensively in all enterprise software, where you don't need to be fancy but need to produce something that works reliably.

Removing them to me is a terrible idea. More terrible if there are not alternatives to these, yes there is the dialog API that is supported only by Chrome, and it's not as simple as the good old alert, prompt or confirm functions. And we know that in the enterprise world we would have to wait years to have all the browsers compatible with new APIs, there are still a ton of people that uses Internet Explorer...

By the way this is a so big breaking change that to me would require a new version of HTML entirely. To the point where the browsers if they encounter a old HTML document they keep the old behavior. But they removed the DTD with HTML5 leaving just <!doctype html> that to me was a terrible idea.


Isn't the better solution for the browsers to collectively improve them in that case rather than ditch them & every site roll their own (with custom styles and the over-the-wire weight of the code to implement it)

In your opinion, what's terrible about these from a UX perspective? Is it just the styling or something else?

The alternative to a default confirm prompt is going to be someone including Bootbox in their site, which I'm not sure how that's much better


A single line of code




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: