Autosubmit focuses fields it shouldn't

Created on 5 November 2024, 10 days ago

Problem/Motivation

With 7.x when using autosubmit it is possible that both $el.attr('data-drupal-selector') and $lastTriggeredSelector are undefined. This causes every field where this happens to be autofocused due to the .each() being used to find correct element.

Steps to reproduce

Create view, make it have at least one multivalue exposed filter and enable autosubmit for BEF.
Enable drupal/chosen (4.x) module which modifies the filter to be incompatible with BEF
Now when loading the page, given filter is auto-opened & auto-focused, and re-focused even if you try use some other filter.

Proposed resolution

At least make sure undefined is not considered as match, but limiting the focus into one element should be considered as well.

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

🐛 Bug report
Status

Active

Version

7.0

Component

Code

Created by

🇫🇮Finland dropa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024