Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Not sure if it fits in one of all "active class" issues.
I have a view with an exposed filter (term). With only that all works ok BUT when you select a term to be used as default element when no filter is present, then "active class" is not working.
I write some js code before .once() and now the active class is working.
Comment | File | Size | Author |
---|---|---|---|
bef-active-class.patch | 965 bytes | carsato | |
Comments
Comment #2
mikeker CreditAttribution: mikeker as a volunteer commentedFYI: When you upload a patch, set the issue status to "Needs review." It help maintainers recognize which issues have something that needs attention vs. those that are just bug reports without a solution.
Anyhow, while this patch fixes the symptom it does not solve the underlying problem and that is what is needed.
Comment #3
mikeker CreditAttribution: mikeker as a volunteer commentedI've fixed up the code that determines which links to put the active filter on and added several tests to ensure this doesn't break going forward. This should fix most of the issues raised here and in #2631804: Wrong filter "active".
Note that there are still some situations where Views makes assumptions about the fact that this will be rendered as a select element. For example, if there is no default value on a non-required boolean filter, the 0 option gets marked as active. But I'm not willing to wait on fixing that before posting this fix.
Also tagging so that this fix doesn't get lost in the D8 upgrade.
Comment #6
carsato CreditAttribution: carsato commentedI'll apply the "Needs review" status for future contributions. Good advise.
Thank you, mikeker.