mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 01:26:10 +02:00
🐛 Fix events inside webcomponent
This commit is contained in:
parent
3f473ca765
commit
5a34c25926
1 changed files with 9 additions and 1 deletions
|
@ -24,6 +24,14 @@ target.stopCallback = function(e, element, combo) {
|
||||||
return false
|
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
|
// stop for input, select, textarea and button
|
||||||
const shouldStop = element.tagName == "INPUT" ||
|
const shouldStop = element.tagName == "INPUT" ||
|
||||||
element.tagName == "SELECT" ||
|
element.tagName == "SELECT" ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue