News for hackers. Stuff that matters.
Re:Customizable HTML Select by crabmusket on Thursday February 20, 2025 @03:38PM (#43119847)
RE autocomplete in Chrome. The only thing we've found to work reliably is ensuring that all inputs are in form elements. Any inputs outside forms are going to have inappropriate autocomplete prompts. It's extremely annoying but at least this works for now.

(I say "for now" because who knows when the Chrome team will change their heuristic?)

Re:Customizable HTML Select by joshuacc on Thursday February 20, 2025 @09:01PM (#43123211)
Why wouldn’t you put your inputs in a form element?
Re:Customizable HTML Select by crabmusket on Thursday February 20, 2025 @10:18PM (#43123629)
I mainly work on a large complex SPA with UX that does not often look like a form, but does have lots of inputs. These days I'm much bigger on semantic HTML, to the small extent it matters in our case, but there is a large burden of pages which were just div soup and loose inputs.
Re:Customizable HTML Select by lelanthran on Friday February 21, 2025 @12:25AM (#43124307)
> Why wouldn’t you put your inputs in a form element?

Not all inputs are form-submission data.

For example a datalist-backed input to scroll to a specific page/chapter/section/subsection in a long document. You might populate the datalist with hundreds of entries so you don't have a long list of links that the user will have to scroll through in the sidebar. You can perform the scroll on the change event of the input.

That's a good UI for the user, instead of presenting a long list of links for the user to browse/search through, they simply have the input auto-suggest based on the populated datalist.

Re:Customizable HTML Select by prmph on Friday February 21, 2025 @02:04AM (#43124852)
Nah, this does not work reliably. The weirdness I've found regarding autocomplete will fill a book.
Re:Customizable HTML Select by martijnarts on Friday February 21, 2025 @03:45AM (#43125455)
I'd love to read a "Falsehoods programmers believe about..." post about this!