Remove filter doesn't work with additional html tags in remove link

Created on 17 September 2025, 3 days ago

If you modify the template so the remove-link has additional html tags inside of it, the javascript crashes when clicking the link.

Example:

<a href="/" class="remove-filter" data-remove-selector="field_test:388" aria-label="Clear Test Filter">
<span>Test Filter</span>
</a>

Results in "views-filters-summary.js?t2r0b0:206 Uncaught TypeError: Cannot read properties of null (reading 'indexOf') at ViewsFiltersSummaryHandler.onRemoveClick"

This is due to line 205 in views-filters-summary.js when it gets the removeSelector element. The problem is it's using the event.target instead of event.currentTarget.

Attached is a patch that fixes the issue.

πŸ› Bug report
Status

Active

Version

3.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Jesmaster

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

Merge Requests

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