Bug 29242 - Flatpickr - Turn autocomplete off
Summary: Flatpickr - Turn autocomplete off
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 29239
  Show dependency treegraph
 
Reported: 2021-10-14 08:28 UTC by Jonathan Druart
Modified: 2022-06-06 20:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 29242: Flatpickr - Should autocomplete be turned off? (1.51 KB, patch)
2021-10-14 18:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29242: Flatpickr - Should autocomplete be turned off? (1.56 KB, patch)
2021-10-16 18:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 29242: Flatpickr - Should autocomplete be turned off? (1.61 KB, patch)
2021-10-31 14:42 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-10-14 08:28:49 UTC
Without autocomplete turned off: https://usercontent.irccloud-cdn.com/file/9NZax9ln/image.png

Should we turn it off?

On Chrome it appears right after the input has the focus, on Firefox you have to double click.
Comment 1 Owen Leonard 2021-10-14 17:24:03 UTC
I like having the browser's autocomplete, but that may just be because I'm almost always in testing mode rather that using it live.

We could set the autocomplete attribute upon initialization of the Flatpickr instance and avoid making any changes to the templates.

Another idea is to tie into the "keydown" function we already have and set autocomplete to "on" if the user types a key other than an arrow key. Probably overkill.
Comment 2 Owen Leonard 2021-10-14 18:03:45 UTC
Created attachment 126302 [details] [review]
Bug 29242: Flatpickr - Should autocomplete be turned off?

This patch adds a step to Flatpickr initialization to add an
autocomplete attribute set to "off" so that browsers' built-in
autocomplete menus do not obscure the calendar.

To test you must be using a browser which has form history enabled.

Locate a form that includes a Flatpickr input field, e.g.  Reports
-> Catalog statistics.

Fill the date fields and submit the form. Go back to the form and click
one of the form fields you previously filled out (once in Chrome, twice
in Firefox). The browser should not show its native form history
dropdown.
Comment 3 David Nind 2021-10-16 18:35:33 UTC
Created attachment 126408 [details] [review]
Bug 29242: Flatpickr - Should autocomplete be turned off?

This patch adds a step to Flatpickr initialization to add an
autocomplete attribute set to "off" so that browsers' built-in
autocomplete menus do not obscure the calendar.

To test you must be using a browser which has form history enabled.

Locate a form that includes a Flatpickr input field, e.g.  Reports
-> Catalog statistics.

Fill the date fields and submit the form. Go back to the form and click
one of the form fields you previously filled out (once in Chrome, twice
in Firefox). The browser should not show its native form history
dropdown.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2021-10-31 14:42:29 UTC
Created attachment 127140 [details] [review]
Bug 29242: Flatpickr - Should autocomplete be turned off?

This patch adds a step to Flatpickr initialization to add an
autocomplete attribute set to "off" so that browsers' built-in
autocomplete menus do not obscure the calendar.

To test you must be using a browser which has form history enabled.

Locate a form that includes a Flatpickr input field, e.g.  Reports
-> Catalog statistics.

Fill the date fields and submit the form. Go back to the form and click
one of the form fields you previously filled out (once in Chrome, twice
in Firefox). The browser should not show its native form history
dropdown.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2021-11-02 15:54:02 UTC
Pushed to master for 21.11, thanks to everybody involved!