Scrolling in interactive terminal UI (FAR Manager)
See original GitHub issueWhen using a console UI tool like FAR Manager, scrolling seems to throw a Unable to preventDefault inside passive event listener invocation.
. I can scroll without errors when I’m not in this terminal UI.
I’ve seen a few other cases/fixes surrounding this but none seem to address this in particular:
https://github.com/xtermjs/xterm.js/pull/2931 https://github.com/xtermjs/xterm.js/issues/3004 https://github.com/xtermjs/xterm.js/issues/3110
I’ve tried altering xterm.js code to remove the preventDefault
in the wheel scroll, and that does seem to stop it, however it then tosses the error when I’m out of the terminal UI.
The line that errors: https://github.com/xtermjs/xterm.js/blob/80d4742ded8029ee9e95aec53200f00d6ce2c569/src/browser/Terminal.ts#L702
Details
- Browser and browser version:
Chrome Version 94.0.4606.81 (Official Build) (64-bit)
- OS version:
Microsoft Windows 10 Enterprise Release [2009] Version 21H1
- xterm.js version:
xterm 4.14.1
Steps to reproduce
- Setup a basic connection to a PTY session
- Start a UI that has scrolling like FAR manager
See image:
Issue Analytics
- State:
- Created 2 years ago
- Comments:21 (10 by maintainers)
Top GitHub Comments
Just wanted to circle back. I reverted my workaround regarding angular zone.js and updated to xtermjs 4.15.0. I no longer get the errors presented in the debugger console. Cheers!
@jherman
preventDefault()
andstopPropagation()
are related, but dont do the same (thats a common misconception found in the internet).preventDefault()
tells the browser not to call its standard handler, whilestopPropagation()
stops the event from cascading through the surrounding DOM elements in capture/bubble phase. Breaking the bubbling chain can avoid the standard handler as a side effect, if the browser has registered it on a parent element, but thats not always the case.Thx for checking again. Indeed we have one wheel handler with
passive: true
, and its behavior is not quite right. The wheel event handlers are a bit convoluted, created https://github.com/xtermjs/xterm.js/issues/3518 to fix that.