[FIX] event: no crash when using t-on + modifier on slots/components

closes #1185
This commit is contained in:
Géry Debongnie
2022-06-01 07:47:45 +02:00
committed by Bruno Boi
parent b56a9c24cf
commit 31fce0926c
3 changed files with 110 additions and 3 deletions
+5 -2
View File
@@ -33,9 +33,12 @@ export function createCatcher(eventsSpec: EventsSpec): Catcher {
this.afterNode = afterNode;
this.child.mount(parent, afterNode);
for (let i = 0; i < n; i++) {
let origFn = this.handlers[i][0];
let handler = this.handlers[i];
// handler = [...mods, fn, comp], so we need to replace second to last elem
let idx = handler.length - 2;
let origFn = handler[idx];
const self = this;
this.handlers[i][0] = function (ev: any) {
handler[idx] = function (ev: any) {
const target = ev.target;
let currentNode: any = self.child.firstNode();
const afterNode = self.afterNode;