🐛 Fix events inside webcomponent

This commit is contained in:
Juanfran 2024-03-22 11:31:53 +01:00 committed by Andrey Antukh
parent 3f473ca765
commit 5a34c25926

View file

@ -24,6 +24,14 @@ target.stopCallback = function(e, element, combo) {
return false
}
if ('composedPath' in e && typeof e.composedPath === 'function') {
// For open shadow trees, update `element` so that the following check works.
const initialEventTarget = e.composedPath()[0];
if (initialEventTarget !== e.target) {
element = initialEventTarget;
}
}
// stop for input, select, textarea and button
const shouldStop = element.tagName == "INPUT" ||
element.tagName == "SELECT" ||