Stop auto submitting first character entered in an Autocomplete Filter field.

Created on 21 July 2020, over 4 years ago
Updated 26 July 2024, 5 months ago

When using exposed autocomplete filters fields the module is autosubmitting any 1st character entered into an autocomplete filter field therefor stopping the autocomplete field from populating the list of options for the user to select.

Keyboard entries into autocomplete fields should not be activating the submit function.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia the_glitch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Work fine for the latest version.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΈπŸ‡°Slovakia coaston

    Found issue - ajax for exposed filters does not work after I applied this patch.

  • Issue was unassigned.
  • πŸ‡ΊπŸ‡¦Ukraine i-trokhanenko Lutsk πŸ‡ΊπŸ‡¦
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    This seems to be working pretty well for us. We changed the timeout from 0.5 seconds to 2.5 seconds. Attaching an updated patch.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    We were also having issues with the autosubmit timing in relation to date fields. I've updated the patch to also include the 2.5 second timeout on to date fields. This patch goes along with the latest dev version.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    After a bit more testing with the previous patch, it looks like this method disables clicking on the browser's calendar icon to update the value of the date field (or at least the autosubmit doesn't happen when that method is used rather than typing in the date field). I'll keep working to try to get a patch that works with either scenario on a date field.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    Adding updated patch which adds a fallback to watch for changes when text/date fields are used. This seems to work when either text is being typed in OR if the user is using the built-in browser date picker on a date field.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    This patch ensures that the 2.5 second delay/timeout is used for all fields and not just text type fields.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    I'm adding an adjusted timeout patch for Views Autosubmit selects. Ensures that all selections are made before the timeout occurs.

  • @saidatom opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    Updated patch to not include indentation changes.

  • πŸ‡ΊπŸ‡ΈUnited States charlyp805

    Patch #25 works. Would you please add the patch to the next release?

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    I was seeing an error on our site with date fields using patch 27 so I've attached an updated version that fixes that issue.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Well for the Grouped filters (Exposed) this create an issue because it takes 2.5 seconds to load results with Ajax so user can think that there are 0 results and choose another option.

    This problem is connected with 3351448 issue which brings ability to configure timeout as per need. For text field you can configure 2500 if needed , but for filters 500ms is good enough.

    So I would suggest to connect both patch together and create one which works for both so instead of :

    -timeoutID = setTimeout($.proxy(triggerSubmit, this.form), 2500);
    +timeoutID = setTimeout($.proxy(triggerSubmit, this.form), drupalSettings.views_autosubmit.timeout);
    

    as described in 3351448

  • πŸ‡ΊπŸ‡¦Ukraine i-trokhanenko Lutsk πŸ‡ΊπŸ‡¦

    I would process with configurable timeout value for text fields πŸ“Œ Configurable timeout value for textfields Fixed It's more flexible I think.

    I've pushed the MR that provides this functionality to the dev branch, see the diff below: https://git.drupalcode.org/project/views_autosubmit/-/commit/274ae5df14f...

    Let's keep this open and see if the community has any additional thoughts/recommendations.

  • Status changed to Needs work 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    Thanks for that update! Unfortunately when testing the dev version, it looks like select fields are no longer triggering the autosubmit. Is anyone else experiencing this when using the latest dev?

Production build 0.71.5 2024