AJAX + Exposed filters as Links + Reset button breaks functionality

Created on 20 September 2022, about 2 years ago
Updated 24 April 2024, 8 months ago

Problem/Motivation

Adding a Reset button to an AJAX-enabled view with exposed filters rendered as links breaks the AJAX functionality.

Steps to reproduce

- Create a view.
- Enable AJAX.
- Add an exposed filter with a few options (e.g. content type).
- Configure said exposed filter to be rendered as links.
- This setup works.
- Add a Reset button.
- Reset button is triggered every time you click on a link.

This is caused by the JS code on line 41 in bef_links_use_ajax.js:

// Submit the form.
$form.find('.form-submit').click();

This clicks on both the submit button and the reset button.

Proposed resolution

Add a CSS class to the submit button and use that as a target in the JS.

๐Ÿ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium beerendlauwers

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.

Production build 0.71.5 2024