Hacker News new | ask | show | jobs
by janpot 459 days ago
I wish they took the use-case of resizable panels into account. Even if the implementation is fully user-land, a styleable separator that can also receive events would be so useful.
1 comments

It's absolutely crazy that the only way to get a native splitter in HTML is to use iframes.
Front end web isn’t my specialty, but I really don’t know why framesets were deprecated. Having resizable panes as a primitive is crazy useful and applicable to several use cases (documentation with a nested tree sidebar comes to mind, for example).

Yeah they were ugly and looked like they came straight out of the Netscape 2.0 era (because they did) but that’s nothing CSS couldn’t have fixed.

Frames and tables were awesome, useful, and simple to learn. While they had their problems, really they just became unfashionable and the result has been a million efforts to replicate what we already had.
This.

At one point people decided that tables are lame.

Iframes on the other hand posed a security issue (cross site scripting) - you have two pages living inside the same window, with possible access and trivial attack vectors like creating a page with one iframe being invisible (1x1px for instance).

But that's just an exception, frontend is really a fashion driven developement and there's often no rhyme or reason to why the mob decides to chose one way over another.

In the "bad old days", tables were abused to build page layouts. There were all sorts of problems with this due to weird rendering rules within table cells and the table itself. Some people piled onto the "omg tables are so bad" fever without properly acknowledging that they are still the best way to display tabular data - their original purpose.
a few days ago, I saw a very old web application that had a f** table inside of a button to center a <IMG> with an icon, with a text.
I can't cite any sources, but I want to say it was a combination of security, state management, and responsive layout that were all a huge headache.
Sounds plausible, but most of those concerns have probably been addressed at this point between the leaps and bounds CSS has made with regards to layout, plus the security work that’s gone into iframes?
what is "native splitter" why do I even want it?
A splitter is the widget that shows two (or more) panes with a divider that you can drag. Commonly used for side bar navigation, see this example: https://codepen.io/Zodiase/pen/qmjyKL

A native splitter is one that is drawn by the browser itself, or even the OS. The only way to get that on the web is with iframes. Otherwise you have to resort to Javascript and manually handling mouse move events as in the example above.

Why do you want that? Same reasons we have `<input>` instead of having every website reimplement text boxes, sliders, checkboxes, etc. with canvas and mouse events.

Sorry I couldn't find an example of an actual iframes website because obviously nobody uses iframes any more.

I believe you mean <frameset>/<frame> rather than <iframe>s, though you used to be able to do frames inside iframes. I’m surprised mobile Safari supports them. Example: https://www.quackit.com/html/templates/frames/frames_example...
Wild! Every browser seems to support <frame> yet it's deprecated: https://caniuse.com/?search=frame
Ah yes you're right! Similar to iframes anyway.

Your example has `noresize` set, but I found one that doesn't: https://www.yourhtmlsource.com/examples/frameset1.html

It's not resizeable on mobile.
It places related content or features of a program alongside or above one another in the same program window so you get all of what you need all right there on the one window. The separate spaces are often resizable, too, so you can fit the content that's important to you however you as the end-user want it. Thus why as another commenter here (izzieto) notes, it's used in almost any application you can think of.
Open any application and you'll see native splitters and their related use cases
Oh this? This isn't a splitter, this is a dialog box.
I don't think that's true. The `resize` rule in CSS can do this.