- Issue created by @tanc
- Status changed to Needs review
3 months ago 2:01pm 9 August 2024
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.
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
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.
Needs review
2.0
Code