3/31/2025 at 3:14:52 PM
The fact that I'm disproportionally excited about this probably dates me as an early 2000s web developer. But since selects can do things that you simply cannot recreate in HTML, e.g. have options drop downs that extend outside the viewport boundaries, makes this a really helpful feature.Now, do autocompletes and tag selectors next...
by wolframhempel
3/31/2025 at 3:22:48 PM
I doubt it'll still be able to do those things. From the article:>Using base-select loses a number of features and behaviors:
> The <select> doesn't render outside the browser pane.
> It doesn't trigger built-in mobile operating system components.
I have mixed feelings about it. Mobile users, get ready for poorly optimized select elements. On the other hand it reduces the need for javascript for styling forms, which is good
by asddubs
3/31/2025 at 6:17:24 PM
> The <select> doesn't render outside the browser pane. ... It doesn't trigger built-in mobile operating system components.To me, this is intrinsically what makes a <select> a <select>. Styling is great, but without these features, this doesn't really bring anything new to the table
by cush
4/1/2025 at 5:48:44 AM
With these features scammers will create all sorts of "you have to log into your password manager" popups again.by wruza
3/31/2025 at 10:37:17 PM
Thanks to humanity, supporting this is a surefire ticket to someone figuring out how to phish credentials through a <select> element.by tadfisher
4/2/2025 at 4:24:36 PM
Certainly, there exists a middle ground between having no options for styling and some options where we don't compromise usersby cush
3/31/2025 at 9:01:06 PM
For the record, there's already a bunch of custom select-a-like replacement elements out there; I'm partial to select2. The main reason for this is that selects don't come with what we used to call "combobox" features; there's no type-ahead completion, and you can't lazy-load options from a larger data source because of that.My main gripe is the loss of rendering outside the browser pane. To be clear, we already don't have that on mobile at all; if you've ever used an iPad with Stage Manager you'll note how popovers - all of them, including native apps - are neatly conformed to the bounds of the containing window. Pop-over menus are supposed to break the window pane, but they don't, for reasons I don't quite understand but can guess rhyme with the word "security".
by kmeisthax
3/31/2025 at 4:44:45 PM
"It doesn't trigger built-in mobile operating system components." Is that part of the spec? I can see Apple deviating from that implementation.by Eric_WVGG
3/31/2025 at 6:57:27 PM
I'm not sure about this. It could break the positioning / sizing / box CSS properties.That would require rendering arbitrary HTML in the native widget, outside the browser. And I think that would require putting WebKit in the native widget. Or, to maintain a "copy" of the widget that looks like the native one but uses WebKit to render things. Seems annoying to maintain.
(And there are the security concerns mentioned by the other comments)
by jraph
4/1/2025 at 12:44:37 AM
Mobile users are the majority of users by far. Do web designers really make their sites hostile to most of their users? (I suspect the answer is yes)by immibis
4/1/2025 at 3:53:28 AM
I think this totally depends on the site in question. Seriously researching something is hell on mobile browsers. As is doing productive stuff. Who wants to work on a tiny screen and no keyboard? On the desktop you can open dozens or hundreds of tabs on a single topic. Therefore I'm not surprised to see that on my site (technical articles) I can see the number of requests from mobile devices is just 17%.Windows is 52%, Linux (without Android) is 18%, Macintosh is 13%, Android 11%, iOS 6%, Chrome OS 0.5%, others <0.5%. (Android and iOS may include tablets, but the overall traffic from tablets is just a few percent.) (Note that I've excluded crawlers and unknown user agents (bots and crawlers) from these results.)
FWIW, some bots lie about what they are, which typically inflates the Windows results. I have another source of data, I can see what types of devices saw my site in Google results, and it's 69% desktops, 30% mobile, 1% tablets. (I can also see how many clicked, and it's similar numbers.)
by qiqitori
3/31/2025 at 3:28:43 PM
That's fair, but I assume that is the initial implementation. Surely, over time, browser vendors will want to make the full spectrum of select functionality available consistently.by wolframhempel
3/31/2025 at 3:46:06 PM
I don't think browsers will ever let web code affect things outside the viewport because scammers would cook up some truly zany things with that power.by caesil
4/1/2025 at 12:46:40 AM
Even rendering arbitrary pixels inside the viewport is bad enough. Something that went out of fashion but is apparently now back in fashion is detecting the user's operating system and browser, then displaying a pixel-perfect replica of a second browser window open to Paypal and asking you to log in... displayed within the bounds of the first browser window.by immibis
4/3/2025 at 6:29:29 PM
This is why the new login prompt of 1Password is worse than the old one, it appears at the center of the screen where the website could easily put a replica. The old one opened at the height of the extension icon, a bit above where the browser opens the alert dialogby afiori
3/31/2025 at 3:54:19 PM
Definitely not. Why would they let web devs render outside of the browser window? That's a recipe for disaster.by dbbk
3/31/2025 at 6:25:47 PM
There needs to be some middle ground. I'd trade off just being able to set just the background color and font and keep these native-like featuresby cush
4/3/2025 at 6:24:53 PM
I think that you can compose arbitrary images that way using an image-like font (using various Unicode chars and assigning to each a small tile of the full image)Actually I am now curious of how much detail/size/colours/animations you can fit in a single letter.
by afiori
4/1/2025 at 1:55:52 AM
The following works for me in Chrome, and doesn't prevent the menu from going outside of the viewport: select, option {
background: red;
font-family: 'comic sans ms';
}
by eurleif
4/1/2025 at 3:32:40 PM
Yeah, it only works in Chromeby cush
3/31/2025 at 10:21:32 PM
If that's all your changing, then why can't you make do with the system default?by maccard
3/31/2025 at 3:17:08 PM
It's actually crazy that we don't have a basic typeahead component or tag selector in this day and age with HTML. Every web page I've ever built has needed these components and while there are libraries out there, they all have an annoying bug here or there.But considering we are just now getting Select tags with styling, signals how long it might take for a typeahead which is vastly more complex.
by majora2007
3/31/2025 at 11:49:13 PM
Why implement broadly useful HTML widgets when you can instead put those engineering resources to work on a new WebBeer API that fetches the number of beers in the user’s fridge or something else similarly niche?by cosmic_cheese
3/31/2025 at 3:18:40 PM
> basic typeaheadIt isn’t perfect, but have you tried <datalist>?
Totally agree about tag pickers, I was bummed to see that Bootstrap didn’t have a tag selector component either.
by jhardy54
3/31/2025 at 3:47:14 PM
I have, and failed.See https://news.ycombinator.com/item?id=40265782
by mlhpdx
3/31/2025 at 6:27:26 PM
It may not be present in Apple’s official documentation but it has been supported since Safari 12.2.See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/da... compatibility. The demo on that page works for me in current Safari on both iOS and Mac.
by ricenews
4/1/2025 at 2:31:54 AM
Some examples seem to work better than others though. I’m on latest iOS and sometimes it will invoke the native date picker like you’d expect to see, sometimes it won’t, and the type ahead doesn’t seem to work consistentlyby no_wizard
4/2/2025 at 7:14:53 PM
That demo shows the problems splendidly. It “only kinda” works on iOS.by mlhpdx
3/31/2025 at 5:32:49 PM
Safari is the "new" IE. I put "new" in quotes because it's been this way for like a decade.by recursive
3/31/2025 at 7:56:20 PM
--- start quote ---Back fifteen years ago IE held back the web because web developers had to cater to its outdated technology stack. “Best viewed with IE” and all that. But do you ever see a “Best viewed with Safari” notice? No, you don’t. Another browser takes that special place in web developers’ hearts and minds.
--- end quote ---
https://www.quirksmode.org/blog/archives/2021/08/breaking_th...
by troupo
3/31/2025 at 9:01:30 PM
Yes, Safari is not exactly like IE because IE had a dominant user share once upon a time.We don't see "best viewed in Safari", but we do see plenty of sites that can be viewed in Safari, despite the extra effort used to get them there. And I'm not even a regular chrome user.
by recursive
4/1/2025 at 8:23:51 PM
The absolute vast majority of web sites require no effort to "get there".The absolute vast majority of those which don't work in Safari use Chrome-only non-standards.
And there is a tiny minority of sites that run into some Safari-specific quirks
by troupo
3/31/2025 at 7:53:32 PM
If anything chrome is the engine with odd quirks you are forced to work around.by facile3232
3/31/2025 at 9:02:33 PM
I haven't found this to be the case in my experience.by recursive
3/31/2025 at 9:03:57 PM
Maybe it's just iframes that are the issue but they were a devil and a half to get working in chrome (or blink ig) without relying on third party cookies.by facile3232
3/31/2025 at 10:47:44 PM
Interested in what you are doing with the iframes. Something with complex authentication? I've been forced to use iframes a few times for 3rd party resources that should have been first-party (mostly with banks and credit unions), and have only had some styling issues on mobile (which have been overcome by using JavaScript and window.matchMedia to check for media queries).by progmetaldev
4/1/2025 at 12:47:29 AM
Chrome's quirks become the standard and other browsers have to implement them.by immibis
3/31/2025 at 3:23:46 PM
also drag and drop rearrangeby asddubs
3/31/2025 at 3:20:33 PM
> have options drop downs that extend outside the viewport boundariesUnless this is about something different from what you mean, unfortunately, it's not the case, as stated in the article:
> Using base-select loses a number of features and behaviors:
> The <select> doesn't render outside the browser pane.
by renerick
3/31/2025 at 5:37:10 PM
> Now, do autocompletesThis is kind of ready, see datalist element.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/da...
by kkarpkkarp
4/1/2025 at 10:01:55 AM
I know about datalist, but it's the saddest autocomplete experience you can offer. If something is not fully styleable, it's automatically garbage. If it's styleable, it may be decent.Now, I understand why datalist is not styleable the way it is implemented right now. On Android, the suggestions come on the top bar of the native keyboard, so it doesn't make sense to be able to put arbitrary divs there. But in that case, there should be an alternative styleable autocomplete element.
Another element that is unstyleable crap is <input type=file>, <audio> too.
by porridgeraisin
3/31/2025 at 4:52:50 PM
<input type="datetime-local"> with automatic ISO8601 timezone offsets would be awesome too!by preisschild
3/31/2025 at 9:29:17 PM
ISO-8601 is not the correct format for serializing local time unless it's in the past.In my experience, a local datetime picker is going to be used almost exclusively for a future date and time. What you want instead of a timezone offset is a zone ID. That way date and tzdata can handle it properly on the backend.
by sublinear
3/31/2025 at 10:54:03 PM
For this case, I will often ask for the timezone, since that data is often updated on the operating system, but I don't believe it's often for someone to be in the same location and have their timezone change. The software that I've maintained the most over the years (since 2009 up to deploying an update today) requires a login, so I have a client account that includes choosing their timezone. I then use that to convert everything to UTC in the database, and when I retrieve the data, I use it to convert UTC back to their local date/time. I felt that it was the best option, since a user moving to a different timezone should still be able to get dates/times back relative to where they have their current timezone set.by progmetaldev
4/1/2025 at 1:00:04 PM
This works for things in the past but not things in the future.If I say I want something to happen at 8pm New York City time on January 7, 2028 and then the DST rules for NYC change, I likely still want it to happen at 8pm. Converting to UTC and back to local time loses that information and it will happen at the wrong time.
by mason55
4/4/2025 at 4:00:48 AM
I 100% agree with you, and don't set cron jobs/scheduled tasks this way. I only use this for displaying date/time to users.With that said, I do appreciate the comment, and would have to make sure that if I run scheduled tasks in the future, they are run when the user wishes them to be completed based on when that user sets it to be completed (so would most likely not convert to UTC, and save the timezone with the date/time).
by progmetaldev
4/4/2025 at 7:18:31 AM
I'd much rather have it just use the system time, which is already available over a javascript API. I wish it just were included in your html form datetime-local request.https://caniuse.com/mdn-javascript_builtins_intl_datetimefor...
or appending the `Date().getTimezoneOffset();` to receive a ISO8601 timezone offset
by preisschild
4/1/2025 at 5:35:55 AM
Right. The offset is not enough without a reference recorded time. You need the time and the time zone in order know the true time. This is a big problem is systems that don't have an intrinsic time type that deploy and have a database full of ambiguous times. Once it happens, backfilling that is a real slog.by ibejoeb
3/31/2025 at 8:00:14 PM
Ooh I can render arbitrary pixels outside the viewpoint. Like a system dialog asking for a password.by blatantly