Skip to content

Commit 21b34c2

Browse files
committed
Fix closest query [data-controller~="live"]
1 parent bcb6a30 commit 21b34c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/LiveComponent/assets/dist/live_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2404,7 +2404,7 @@ class LoadingPlugin {
24042404
getLoadingDirectives(element) {
24052405
const loadingDirectives = [];
24062406
let matchingElements = [...element.querySelectorAll('[data-loading]')];
2407-
matchingElements = matchingElements.filter((elt) => elt.closest('[data-controller="live"]') === element);
2407+
matchingElements = matchingElements.filter((elt) => elt.closest('[data-controller~="live"]') === element);
24082408
if (element.hasAttribute('data-loading')) {
24092409
matchingElements = [element, ...matchingElements];
24102410
}

src/LiveComponent/assets/src/Component/plugins/LoadingPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default class implements PluginInterface {
153153
let matchingElements = [...element.querySelectorAll('[data-loading]')];
154154

155155
// ignore elements which are inside a nested "live" component
156-
matchingElements = matchingElements.filter((elt) => elt.closest('[data-controller="live"]') === element);
156+
matchingElements = matchingElements.filter((elt) => elt.closest('[data-controller~="live"]') === element);
157157

158158
// querySelectorAll doesn't include the element itself
159159
if (element.hasAttribute('data-loading')) {

0 commit comments

Comments
 (0)