From 7a7cd8fe23bfdf3866bac4f15047695522bd092b Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 8 Sep 2026 13:34:57 +0200 Subject: [PATCH] Always reset _trim_top when canvas fits to avoid stale positioning for click calculation --- nomadnet/vendor/Scrollable.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nomadnet/vendor/Scrollable.py b/nomadnet/vendor/Scrollable.py index e40bef0..c3010b9 100644 --- a/nomadnet/vendor/Scrollable.py +++ b/nomadnet/vendor/Scrollable.py @@ -83,6 +83,10 @@ class Scrollable(urwid.WidgetDecoration): if canv_cols <= maxcol and canv_rows <= maxrow: # Canvas is small enough to fit without trimming + if self._trim_top != 0 or self._scroll_action is not None: + # Reset potentially stale _trim_top + self._trim_top = 0 + self._scroll_action = None return canv self._adjust_trim_top(canv, size)