Exposed filter's JS events not attached on initial load.

Created on 24 April 2020, over 4 years ago
Updated 5 November 2024, 16 days ago

Problem/Motivation

Current Setup: Drupal 8.8, Entity Browser 8.x-2.2

When a entity browser loads, the JS behaviors for the exposed filters are not attached. So a user is unable to search for media until attachBehaviors is executed a second time. The library 'entity_browser/view' relies on a window object `Drupal.views.instances` that is instantiated by the core library 'views/views.ajax'. It was observed that these libraries were loading in an order that didn't satisfy this dependency, meaning `Drupal.views.instances` wasn't set in time for entity_browser attach.

I'm unsure if there is a third-variable problem at work here (assume this issue would be more prevalent), it seems good practice to declare the dependency based on the use of `Drupal.views.instances`.

Proposed resolution

Add explicit dependency on 'views/view/ajax' in entity_browser.libraries.yml to 'view'.

Remaining tasks

Create patch. Have community verify need.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Fixed

Version

2.2

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024