Use data-drupal-selector as returned target and trigger values

Created on 17 November 2024, 17 days ago

Problem/Motivation

Two of the request headers used by HTMX use the HTML id property. Since these can be dynamic in Drupal, a data-drupal-selector is provided by core.

Proposed resolution

Add to `htmxDrupalPageState()`

// Swap in drupal data selectors as #id values are altered to be unique.
configRequestEvent.detail.headers['HX-Target'] = configRequestEvent.detail.target.dataset.drupalSelector;
configRequestEvent.detail.headers['HX-Trigger'] = configRequestEvent.detail.elt.dataset.drupalSelector;
πŸ“Œ Task
Status

Active

Version

1.3

Component

Drupal Code

Created by

πŸ‡ΊπŸ‡ΈUnited States fathershawn New York

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