|
|
|
|
|
by ximm
1763 days ago
|
|
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. |
|