Skip to content

Commit d029370

Browse files
committed
fix(input): fix input handling
1 parent c80bd85 commit d029370

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/reconciler/host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const hostReconcile: Reconciler = (opt) => {
116116
(opt.shadowCache.node as Element).addEventListener(
117117
inputEvent.key,
118118
(evt: Event) => {
119-
const shadowElement = opt.shadowElement as ShadowHostElement;
119+
const shadowElement = opt.shadowCache.value as ShadowHostElement;
120120
const newValue = (evt.currentTarget as HTMLInputElement).value;
121121

122122
shadowElement.props[`${EVENT_PREFIX}${inputEvent.key}`](evt);

test/host.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ describe("webcomponent", () => {
154154

155155
expect(
156156
(component.shadowRoot?.childNodes[0] as HTMLInputElement).value,
157-
).to.equal("foo");
157+
).to.equal("foobar");
158158
});
159159

160160
it("registers input event without updating", async () => {

0 commit comments

Comments
 (0)