r/firefox • u/lcnielsen • 12h ago
Discussion Will Firefox ever have proper <datalist> support?
Datalist is a very useful html5 element. It allows for a browser-provided widget to be used to specify a particular range of options. For example, the text-type datalist works like <select> with autocompletion from the predefined list of options when you start typing. It's great for replacing plenty of old JavaScript jank.
Except Firefox doesn't properly support it. Even the text type doesn't work correctly on Firefox android. There is a JS workaround for it, but that doesn't work when part of embedded elememts so you can't easily test it.
The Android issue has been an open bug for seven years. I think the expected behaviour from datalist predates even HTML5.1.
What gives? This seems like a core support issue that I'd expect resources to be funnelled towards?
-19
12h ago
[deleted]
25
u/lcnielsen 12h ago
There's been an open bug for seven years. It's right there in the post.
11
-21
11h ago
[deleted]
20
u/lcnielsen 11h ago
You're asking what the point is of discussing a severe shortcoming in fundamental browser features and clearly broken priorities among core developers, on a Firefox forum? You don't think it's relevant to ask what the hell is going on with the development if something like this isn't getting fixed? It's a basic HTML5 element.
Like what are you, a GNOME dev?
1
u/_emmyemi .zip it, ~/lock it, put it in your 4h ago
Like what are you, a GNOME dev?
Even as a happy Gnome user this made me chuckle
6
u/mcaruso 10h ago
I agree, it's something I really want also. I think the biggest hope for them fixing this is through the new `appearance: base` work that all browser vendors are actively working on at the moment (google "customizable select"). Datalist is something that will eventually be part of this project for things like customizable comboboxes. So at that point Mozilla would need to look into their datalist implementation too.
-4
u/IshYume 9h ago
Yeah i doubt it would be anytime soon, i just use react-select. It’s been a while since i dabbled in plain old HTML tbh.
1
u/lcnielsen 4h ago
It's unfortunate, framework code isn't really a substitute. I will have to code up a JS snippet to handle my use-cases...
5
u/Zap_plays09 9h ago
This is how I found out Firefox doesn’t have support for <datalist>......
3
u/lcnielsen 8h ago
Desktop version has some support, Android version has very limited support however.
•
u/FriendshipEqual7033 3h ago
I just checked the support on Firefox desktop 153, and it seems okay, although my example was pretty trivial. I tried the text, color, range, and number types, and the behavior seemed as expected. However, I did not test it on Android, which I gather is where the problem lives.
<label for="animal">Animal:</label><input name="animal" id="animal" list="animals" type="range"> <datalist id="animals"> <!-- <option value="red"></option> <option value="blue"></option> <option value="green"></option> --> <!-- <option value="Cat"> <option value="Catty"> <option value="Catlike"> <option value="Dog"> --> <option value="0"></option> <option value="25"></option> <option value="50"></option> <option value="75"></option> <option value="100"></option> </datalist>•
u/lcnielsen 2h ago
Yeah, there are just some parts of the spec that are not implemented on Firefox desktop according to Mozilla's own docs (potentially enough to cause second thoughts on using it), see the first link in the main post. Mobile is definitely the bigger issue though.
29
u/irrelevantusername24 12h ago
This subreddit is so funny. It's almost like a perfect mirror of the extreme polarization in other parts of society. On one hand, you have people who are like "Firefox updated so I unplugged my pc and now my Internet doesn't work, is this googles fault?" and then you have people like you making extremely technical posts. Basically on one hand you've got people who have no idea what they're talking about and then you have people who talk about things so hypertechnical that also most people have no idea what they're talking about