Reset/Remove AJAX buttons require 2 clicks to actually clear filter

Created on 15 April 2025, 5 days ago

Problem/Motivation

I am using this module along with better_exposed_filters module and it takes 2 clicks on views-filters-summary-remove-filter or views-filters-summary-reset before it actually clears out.

The view filter contains some Event Types.

After the first click it does a ajax call and it the payload it still contains the event type that was selected.

/views/ajax?event_type[23077]=23077&sort_by=name&sort_order=ASC&_wrapper_format=drupal_ajax&sort_by=name&sort_order=ASC

the response comes with the checkbox still ticked in the replaceWith command.

After the second click it does the correct Ajax call and the payload does not contain the event type anymore.

/views/ajax?sort_by=name&sort_order=ASC&_wrapper_format=drupal_ajax&sort_by=name&sort_order=ASC

Steps to reproduce

It takes 2 clicks on views-filters-summary-remove-filter or views-filters-summary-reset before it actually clears out.

I checked the reset(exposedForm) and onRemoveClick functions and it goes through setting input.checked = false; (thought it was skipping that but no)

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡·πŸ‡΄Romania emiliasc

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

Comments & Activities

  • Issue created by @emiliasc
  • πŸ‡«πŸ‡·France mably

    I cannot reproduce the problem on my side.

    Could you give us a repeatable scenario from a fresh Drupal 11 install?

  • πŸ‡ΊπŸ‡¦Ukraine vbory

    The problem appears when the view has AJAX enabled. Then for the first time it clean up the URL paratmeters, however the view still shows the previously filtered data and then when you click second time it removes the filters and the summary section.

Production build 0.71.5 2024