top | item 38252577

(no title)

jtcasper | 2 years ago

The <datalist> element with a text input field is an HTML native typeahead, which works great with SSR or you could wire up the datalist client side with an XHR creating the datalist.

You maybe don't get full control over the rendering style of it, but it's a still significantly more usable than the Angular Material autocompletes.

discuss

order

dmix|2 years ago

That's an interesting one I wasn't familiar with.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/da...

It's a shame clicking on it doesn't show the options like a select box though.

couchand|2 years ago

Click again I guess?

> Recommended values in types text, search, url, tel, email and number, are displayed in a drop-down menu when user clicks or double-clicks on the control.

cdcarter|2 years ago

Clicking it shows the options for me (Chrome 119).

xigoi|2 years ago

<input> with <datalist> still doesen't work on Firefox Android.