Skip to content

Commit 9276bfd

Browse files
committed
d
1 parent 702e25d commit 9276bfd

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

pages/html/input/handleInput.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ function handleInput(parentToBind, event, options = {}) {
5151
}
5252
}
5353
for (const input of inputs) {
54-
event(new Event("mutation"), input);
54+
const e = new Event("mutation");
55+
Object.defineProperty(e, "target", { writable: false, value: input });
56+
event(e, input);
5557
}
5658
});
5759
observer.observe(parentToBind, { childList: true, subtree: true });
@@ -60,7 +62,9 @@ function handleInput(parentToBind, event, options = {}) {
6062
const inputs = [...findInputs(parentToBind)];
6163
for (const input of inputs) {
6264
if (detectElement(input)) {
63-
event(new Event("load"), input);
65+
const e = new Event("load");
66+
Object.defineProperty(e, "target", { writable: false, value: input });
67+
event(e, input);
6468
}
6569
}
6670
}

pages/html/input/handleInput.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export default function handleInput(
7878
}
7979

8080
for (const input of inputs) {
81-
event(new Event("mutation"), input);
81+
const e = new Event("mutation");
82+
Object.defineProperty(e, "target", { writable: false, value: input });
83+
event(e, input);
8284
}
8385
});
8486

@@ -90,7 +92,9 @@ export default function handleInput(
9092

9193
for (const input of inputs) {
9294
if (detectElement(input)) {
93-
event(new Event("load"), input);
95+
const e = new Event("load");
96+
Object.defineProperty(e, "target", { writable: false, value: input });
97+
event(e, input);
9498
}
9599
}
96100
}

0 commit comments

Comments
 (0)