Problem/Motivation

The search text filter isn't working when the "Include filter by label" option is enabled for the Image Select element; it does not filter images.

Steps to reproduce

1. Create an Image Select element.
2. Check the "Include filter by label" checkbox in the element settings.
3. Try to use the search text filter.

Proposed resolution

We have to edit the following file: /webform/modules/webform_image_select/webform_image_select.libraries.yml.
js/webform_image_select.element.js: {} should be replaced with js/webform_image_select.element.js: {weight: -1}.
This way, we will include webform.filter.js after webform_image_select.element.js to ensure that the $('.js-images-filter .thumbnails') element is available before webform.filter.js attempts to access it.

Issue fork webform-3511937

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

furamag created an issue. See original summary.

cilefen’s picture

Status: Active » Needs review
jrockowitz’s picture

We have been using this patch on production and it seem sreasonable that we want to ensure the webform_image_select.element library loads after webform.filter.js

  • 54def7da committed on 6.2.x
    Issue #3511937: The Filter by Label search box isn't working for the...

  • 7ee99a5f committed on 6.3.x
    Issue #3511937: The Filter by Label search box isn't working for the...
jrockowitz’s picture

Status: Needs review » Fixed

Fixing in 6.2.x and 6.3.x

  • 7ee99a5f committed on 6.x
    Issue #3511937: The Filter by Label search box isn't working for the...

Status: Fixed » Closed (fixed)

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