Skip to content

Commit 94bf88a

Browse files
committed
fix: prevent typing only inside of textarea and input
1 parent b727dd1 commit 94bf88a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/builder/app/canvas/interceptor.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,13 @@ export const subscribeInterceptedEvents = () => {
159159
if ($isPreviewMode.get()) {
160160
return;
161161
}
162-
// prevent typing in inputs only in canvas mode
163-
event.preventDefault();
162+
if (
163+
event.target instanceof HTMLInputElement ||
164+
event.target instanceof HTMLTextAreaElement
165+
) {
166+
// prevent typing in inputs only in canvas mode
167+
event.preventDefault();
168+
}
164169
};
165170

166171
// Note: Event handlers behave unexpectedly when used inside a dialog component.

0 commit comments

Comments
 (0)