Problem/Motivation

element.find('[name]') selects all elements with a name attribute, including divs, form elements, etc. However, this.name only works for form elements, returning undefined for non-form elements like divs

Steps to reproduce

So, we're using drupal/better_exposed_filters along with a Links widget, and 'Allow multiple selections' is disabled. The issue was that we couldn't deselect an already selected filter

Proposed resolution

this.getAttribute('name') should work for reading the name attribute from div elements as well

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

dejan0 created an issue. See original summary.

dejan0’s picture

Status: Active » Needs review
StatusFileSize
new662 bytes

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

vitaliyb98’s picture

Tested these changes, worked on my side, also moved changes from the patch to the MR.

i-trokhanenko’s picture

Status: Needs review » Reviewed & tested by the community

  • i-trokhanenko committed 0a549867 on 8.x-1.x
    Issue #3514479 by dejan0, vitaliyb98, i-trokhanenko: name attribute on...
i-trokhanenko’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
i-trokhanenko’s picture

Status: Patch (to be ported) » Fixed

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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