Only send wheel mouse event when scrolling a line or more
This commit is contained in:
@@ -703,10 +703,13 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
|||||||
but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;
|
but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;
|
||||||
break;
|
break;
|
||||||
case 'wheel':
|
case 'wheel':
|
||||||
// only UP/DOWN wheel events are respected
|
const amount = self.viewport!.getLinesScrolled(ev as WheelEvent)
|
||||||
if ((ev as WheelEvent).deltaY !== 0) {
|
|
||||||
action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;
|
if (amount === 0) {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;
|
||||||
but = CoreMouseButton.WHEEL;
|
but = CoreMouseButton.WHEEL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user