drupalSettings are never removed after AJAX request

Created on 10 May 2024, 8 months ago
Updated 30 May 2024, 7 months ago

Problem/Motivation

When using this module on an AJAX view, settings are always added and never removed after each AJAX request, so the autocomplete will suggest values that are not valid anymore.

Steps to reproduce

  1. Create a search_api view with AJAX enabled.
  2. Create facets_autocomplete facet for this view + another facet.
  3. Click on the other facet to reload the view with AJAX and restrict the possible values in the autocomplete facet.
  4. Old outdated values are still suggested by the autocomplete facet.

Proposed resolution

One way to avoid this would be to empty the settings after using them. This way the array would be empty the next AJAX response returns.

(I guess it could be cleaner to do it when detaching the behavior, but we would need a way to know if the setting is still needed or not.)

πŸ› Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

πŸ‡«πŸ‡·France prudloff Lille

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024