fix: xterm.js mobile touch scrolling via viewport CSS and stopPropagation

- Add full mobile viewport CSS: overflow-y scroll, -webkit-overflow-scrolling
  touch, overscroll-behavior-y contain, translate3d hardware accel,
  scroll-behavior smooth, touch-action pan-y
- After term.open(), find .xterm-viewport and add passive touch listeners
  that call stopPropagation() (not preventDefault) — this lets the browser
  handle native touch scrolling while preventing xterm.js internal handlers
  from interfering
- Based on xterm.js known issue #5489 and SCROLLING_FIX.md approach
This commit is contained in:
Alex Blank
2026-05-29 20:16:12 +02:00
parent ef9ac76f06
commit 874873541d
2 changed files with 37 additions and 2 deletions
+5
View File
@@ -3716,6 +3716,11 @@ a.nav-item,
/* Mobile: allow native vertical touch panning on xterm viewport */
.terminal-wrapper.mobile .xterm .xterm-viewport {
touch-action: pan-y;
overflow-y: scroll !important;
-webkit-overflow-scrolling: touch !important;
overscroll-behavior-y: contain;
transform: translate3d(0, 0, 0);
scroll-behavior: smooth;
}
/* Special Keys Strip */