From 9c17885289ebcb5599035e12a25c174a67143a59 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:21:37 +0100 Subject: [PATCH] No mouse scrolling when scrolling is turned off. --- textview.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/textview.go b/textview.go index e5c8846..743bd6d 100644 --- a/textview.go +++ b/textview.go @@ -1399,10 +1399,16 @@ func (t *TextView) MouseHandler() func(action MouseAction, event *tcell.EventMou } consumed = true case MouseScrollUp: + if !t.scrollable { + break + } t.trackEnd = false t.lineOffset-- consumed = true case MouseScrollDown: + if !t.scrollable { + break + } t.lineOffset++ if len(t.lineIndex)-t.lineOffset < height { // If we scroll to the end, turn on tracking.