Ability to manipulate facet checkboxes link with JS

Created on 9 August 2024, about 2 months ago

Problem/Motivation

I have a use case where I want to manipulate the checkbox facet links with JS after they have been created. My use case is that I want to add a query parameter to the facet link that relates to the currently active tab in tabbed interface.

The way facet checkboxes are currently coded is that the href attribute is passed into the event listener function when the checkboxes are first created. Manipulating the href later does not have any effect on the event handler.

Steps to reproduce

Create some facets
Manipulate the href of a facet checkbox with JS
Not that when clicking on that facet the manipulated URL isn't used

Proposed resolution

Instead of passing in the href value when the checkbox is created the event listener function could check the current value of the anchor tag's href attribute. This would allow manipulation of the href and therefore the facet url when the facet is triggered.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇹Italy tanc Italy

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024