4 ms·
I didn't know about datalist, but now I'll start using it. I've been annoyed at the multitude of completion implementations that all behave slightly differently
by koala_man 4y ago
I didn't know about datalist, but now I'll start using it. I've been annoyed at the multitude of completion implementations that all behave slightly differently.
- swyx 4y agoi think the problem with datalist is the default styles, and the lack of customizability (eg if you want multiple slections, or to display descriptions or images next to each choice, or you want fuzzy matching). most of the time you'll just want to go ahead and import a ComboBox component someone else has made
- timw4mail 4y agoThe problem is more the inconsistent behavior. Styling is also a concern, but why doesn't the Option element behave the same in a datalist as in a select? (I think only Firefox actually does this properly).
- timw4mail 4y agoYeah, it's really odd. Some browsers will only show the value, some will show the label and the value, and some will (properly) show the label when you have both a label and a value. It kind of drives me nuts that it doesn't work the same way as the select element, when you are using option elements as a list.