Always reset _trim_top when canvas fits to avoid stale positioning for click calculation

This commit is contained in:
Mark Qvist
2026-09-08 13:34:57 +02:00
parent 774c08905f
commit 7a7cd8fe23
+4
View File
@@ -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)