Hacker News new | ask | show | jobs
by defanor 1421 days ago
I'm annoyed by modals on web pages (along with any excessive JS) as much as the next person, but:

> What's the difference between a dedicated page that has a link "return back to the table", and a modal that you cannot close by clicking on the overlay. And the only way to close it is by clicking the close button/icon which in fact returns you back to the table as well?

I think they tend to happen because (for whatever reason) people make SPAs, which is precisely about having everything on a single page; then opening a new one is slow (thanks to multi-megabyte JS) and contrary to the whole approach. And when you propose to avoid SPAs, it's met with "but Google does that", "that's modern", and so on.

Edit: Actually I've misinterpreted the article (and "dedicated page") and mixed up modals with SPAs, as pointed in one of the replies.

1 comments

There's not reason you can't have a "dedicated page" with a back button (or even respecting the real back button) in an SPA. Modals are created by lazy designers, devs only implement them.
Indeed, my bad, and it makes more sense upon re-reading it with just SPAs in mind (instead of picturing/comparing a modals-heavy SPA and a regular bunch of pages). I just have a strong association of modals with SPAs, but they don't necessarily go together.
Actually there is. HTML5 Canvas state gets lost. It's the only case, but I know from experience that it can be very significant depending on the application
you're still in the SPA. You generally need some sort of painters algorithm to repaint the canvas anyway. When the canvas comes back you would just repaint it from JS memory.

Canvas in particular has issues web devs have to deal with beyond their "normal" duties. Accessibility is simply not even a thing in canvas. Google Docs had to implement an entire parallel invisible DOM structure to emulate what they draw on the canvas when they were switching over to the canvas. And, of course, that DOM structure has to be in sync with canvas.

Sure. But in that case I think a modal makes more sense. A page with a complex canvas that has state ideally should be the last page in the SPA navigation. Nothing should be able to "go back" to that page. What you describe is more a way to "go forward" to that page, since you're essentially reloading the canvas (which is fine but adds overhead in terms of state and response time)
YES

Especially when the modal covers half of the page, with a form with dozens fields.