Problem/Motivation

The links widget uses the checkbox-widget library, thus transforming the facet link to a span display.

In 2.x the link widget had its own library, this in now gone in 3.0. But still not sure whether the link widget should receive the checkbox widgets library. At least now this part in the template that marks a link active is now removed by the checkbox widget js and thus there is no default visual indication that a facet link is active (by CSS class, but not without class just in plain HTML).
The checkbox widget is now extending from the link widget, maybe that is the reason why the library is added to both. But this could probably be solved in using different implementation of appendWidgetLibrary in Link Widget and Checkbox Widget

There has been something about the link widget display in #3309612: Link widget styling. Imho this is "repairing" styling for links, which in the first place got "broken" through the checkbox widget library added to the links widget.

Steps to reproduce

Use a facet with link widget and note that if you select a facet, you will not see the

(-)

indicator known from 2.x.

Proposed resolution

Do not use the checkbox widget library on the link widget. It seems, it will work without this as well and it will look and behave more like expected and like 2.x. The changes from #3309612: Link widget styling can then be reverted too probably.

Remaining tasks

User interface changes

Back to 2.x like style and behavior for links widget

Issue fork facets-3447859

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

stefan.korn created an issue. See original summary.

stefan.korn’s picture

Status: Active » Needs review
stefan.korn’s picture

stefan.korn’s picture

There is another issue if a link facet and a checkbox facet are used together. The checkbox facet js will also target links, which makes them loose styling like #3309612: Link widget styling claims. The facet checkbox js should not target links.

mlncn’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community
Related issues: +#3360920: Links widget is loading the checkbox widget JS library

Related, possible duplicate, #3360920: Links widget is loading the checkbox widget JS library, and wow i 1,000% agree with all that have worked on both issues that links should not be converted to spans by JavaScript needlessly! In addition to all the problems mentioned, it means that a theme's link stylings are not used. This is at least major and this surprisingly simple patch fixes it all, for me. Less code, much less overhead, better functionality == win.

candalt’s picture

Can confirm that the plain diff is working fine on Drupal 10.3.10 and Facets 3.0.0.

s3b0un3t’s picture

Hello,

Unlike the other two issues mentioned, I think the fix for this one is the most elegant and comprehensive.

Tested and validated in version 3.0.0 (in Drupal 11.1.3).

THANKS !

ericgsmith made their first commit to this issue’s fork.

ericgsmith’s picture

+1 for RTBC - this is super important to get in and a major accessibility issue

Have closed #3508981: "List of links" not working in 3.0 as a duplicate. This is technically a duplicate of #3360920: Links widget is loading the checkbox widget JS library which is older, although the solution here is complete and RTBC'd already.

Suggest the maintainer consider closing that and assigning credit from the related issues.

MR was showing with an unreleated test failing - have rebased and showing as green now.

strykaizer made their first commit to this issue’s fork.

strykaizer’s picture

Issue tags: +Vienna2025

strykaizer’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.