Bringing Back Horizontal Rules in HTML Select Elements
webkit.org
webkit.org
In my Sciter[1] the following are supported ( see screenshot [2] ):
<select type="dropdown"> - select with popup
<select type="list"> - select list
<select type="tree"> - hierarchical select (a.k.a. tree view)
and all of them may have <select multiple> - multi-select, value = array[]
<select multiple="checkmarks"> - multi-select, value = array[]
select type="tree" may have also <select type="tree" treelines> - draw treelines
<select> and <option>'s may have arbitrary markup inside (<hr>,<img>, whatever), even more any DOM element may have role="option" defined making it a selectable option : <li role="option">...</li>
<option value="Sc"><code>Sc</code>Scandium</option>
And as a bonus, by declaring different flows in CSS in list you may have: select { flow:horizontal; } // horizontal select
select { flow:vertical-wrap; } // multicolumn select
[1] https://sciter.com
[2] https://sciter.com/wp-content/uploads/2024/01/select-variant...There isn't a problem. Your flexibility is just in the wrong place—the flexibility is on the side of the user and user agent, e.g. to manifest and interact with a "<select multiple>" input method however best for the device that the user is looking at the form with. The fact that it's not actually codified anywhere exactly how "<select multiple>" should work is a good thing. Your approach does away with that.
select2 does something similar but yea it's weird this isn't a built-in
maybe a dropdown with checklists?
That's builtin with <select multiple> but it's only usable on mobile.
[0] https://html.spec.whatwg.org/multipage/form-elements.html#th... (see the "Content model" line)
[0] https://www.mozilla.org/en-US/firefox/122.0/releasenotes/#no...
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/se...
For those without iOS, see an example here: https://ibb.co/DkN16Gc
And please, just give us an attribute that adds a search bar... I don't want to use 30 KB of JavaScript just to have selects that feel like they're from this millennium, especially since those then don't work too well on mobile…
That's the datalist html element.
(Note though that you aren't limited to Ctrl-clicking. There's Shift-clicking, too, as well as mouse lassoing. Assuming your UA supports it, that is.)
On desktop (Chrome on Mac) each optgroup label is just a disabled item, and then its options are indented menu items below it.
It looks totally hacky -- the name of a group shouldn't seem like "disabled" option, nor are indentations in menu items an established convention.
That sheet on iOS is perfectly intuitive, however.
[1] Link to page section with demo: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/se...
Why not just make horizontal rules between optgroups the default?
https://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.1....
Except for all the users who were frustrated by the change. Most users wouldn’t even know who to report this to, even if they noticed it at all. They may chalk up the issue to the new computer or phone they purchased in the last two decades.
I wonder if anyone on the WebKit team looked at the blog post example in Mobile Safari?
Sigh, you still don't seem to get it. The point of code is to provide functionality to the user. If I want to visually separate the options, the <hr> on iOS does not provide the functionality. Thus, I need to do something else on iOS in order to visually separate the options, and thus I can't share the <hr> code with other platforms.
"no less usable" is a misleading way of phrasing the problem. The <hr> on iOS is not usable at all as a visual separator between options in a select element. It's pointless, with no use.
How is that relevant to my point?
> this is a fairly typical case of/for graceful degradation.
I'm not interested in "degradation". I'm interested in my code actually working as intended and serving a useful purpose. It's great that the <hr> on iOS degrades gracefully, but that still doesn't help me even one tiny bit.
Choosing to serve different code to different browsers complicates development and maintenance, for almost no upside (minuscule bandwidth savings).
Serving the same code, including serving <hr>-in-<select> to iOS, has the significant benefit of simplifying development and maintenance, has the benefit of automatically "upgrading" iOS users to your better experience once their browser supports it, and has no negative impact on usability (the iOS <select> looks and behaves identically with or without the <hr>).
That is the point eyelidlessness is trying to make. There are two courses of action, one of which has a lot of downside and little upside, the other has a fair amount of upside and no downside. That's what he meant when he pointed out that "it’s no less usable with the <hr> than without."
I didn't say I was going to serve different code to different browsers. I said I would have to serve different code to different browsers if I used <hr> in <select>. That's a hypothetical. The alternative is actually to use a totally different technique for separating options that works on both desktop and mobile.
> for almost no upside (minuscule bandwidth savings).
It's not about bandwith! It's 100% about the user interface. That's what neither you nor eyelidlessness seems to understand. The entire point of using <hr> in <select>, or some other technique for separating options, is for the user interface.
> no negative impact on usability (the iOS <select> looks and behaves identically with or without the <hr>).
What you describe is a usability problem. That's a bug, not a feature.
It really boggles my mind that you can't understand the basic requirement: I want to separate the options on both Mac and iOS. Leaving the options unseparated on iOS is not an acceptable alternative.
The practical requirement is the user interface.
The entire purpose of the <hr> in <select> is to visually separate the options for the user. If the visual separator only appears for some users but not for other users, that's a failure of the user interface.
Imagine if it wasn't Mac vs. iOS users but rather that there was a WebKit bug where the <hr> only appeared 50% of the time, randomly, for Mac users. Wouldn't you consider that to be a problem?
For an example of how they look like in iOS 17.3 or earlier, long press the address bar/tab title in Safari
On iOS 17.4, you’ll be able to see that the divider is thicker and obvious. Long-press on the Safari address bar for an illustrative example. See the gap between “Voice Search” and “Move to Tab Group”?
The blog post didn't mention iOS at all. I'm glad to hear that the feature is coming in the future, though it's strange that the blog post didn't mention it, and also strange that they didn't implement it in 17.0 at the same time as desktop.
Probably because iOS 17.4 is in beta and just got released a few days ago.
This is a very odd coincidence, since the Mac change was released way back in September with version 17.0, which the blog post does mention.
(Firefox)
Sigh.
On the other hand we've got a "custom elements" implementation that's far more ergonomic and implemented across all platforms, some of them even let you play with the "internals" mechanisms, and all if it is better than I remember any GUI toolkit providing.