Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/@wterm/dom/src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ export class InputHandler {
this.textarea.setAttribute("tabindex", "0");
this.textarea.setAttribute("aria-hidden", "true");
const s = this.textarea.style;
s.position = "absolute";
s.left = "-9999px";
// Keep the focus target in the viewport so mobile/Chromium browsers do not
// try to scroll the page to reveal an off-screen textarea while typing.
s.position = "fixed";
s.left = "0";
s.top = "0";
s.width = "1px";
s.height = "1px";
Expand Down Expand Up @@ -145,7 +147,7 @@ export class InputHandler {
if (sel && sel.toString().length > 0) return;
}
if ((e.metaKey || e.ctrlKey) && e.key === "v") {
this.textarea.focus();
this.textarea.focus({ preventScroll: true });
return;
}
if (e.metaKey && !e.ctrlKey) {
Expand Down