Comment by crabmusket

2 days ago

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?)

Nah, this does not work reliably. The weirdness I've found regarding autocomplete will fill a book.

Why wouldn’t you put your inputs in a form element?

  • > 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.

  • 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.