datamade / django-councilmatic

:heartpulse: Django app providing core functions for *.councilmatic.org
http://councilmatic.org
MIT License
26 stars 16 forks source link

Rename front-page form field to prevent browser auto-suggestion #125

Open patcon opened 7 years ago

patcon commented 7 years ago

@gabesawhney and Hillary Lorimer have been leading user testing, and one small thing that came up repeatedly was the confusion over our "auto-complete" that they were seeing on the front page legislation search field.

Turns out that it's a helpful browser feature that is based on the form field "name" attribute. We chose to use "q", and so that's shared with many other forms (like google)

https://github.com/datamade/django-councilmatic/blob/master/councilmatic_core/templates/councilmatic_core/index.html#L22

Any objection to changing this to something more unique, like "legislation-search"?

patcon commented 7 years ago

Actually, seems that the request.GET.q is baked pretty deeply (and it's self-explanatory), so likely want to avoid changing that :)

Seems that adding an "id" attrib might resolve it: https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/

patcon commented 7 years ago

Seems that adding an "id" to the input tag doesn't actually resolve anything on FF -- only changing "name" value does that. That seems odd, as "q" is a very common querystring, and I would have thought this would come up elsewhere.

What about simply setting autocomplete="off"? It sucks to lose, but right now it's autocompleting with previous google searches, which is pretty confusing.