From 53d50dbc3bf070b5558f8bf5f4d2cc30887b2476 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:51:39 +0100 Subject: [PATCH] fix: guard scroll operations against infinite extents --- lib/focus/focusable_wrapper.dart | 1 + lib/screens/libraries/tabs/library_browse_tab.dart | 10 +++++++++- lib/utils/scroll_utils.dart | 8 ++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/focus/focusable_wrapper.dart b/lib/focus/focusable_wrapper.dart index 1abb2aed..e9ed636f 100644 --- a/lib/focus/focusable_wrapper.dart +++ b/lib/focus/focusable_wrapper.dart @@ -306,6 +306,7 @@ class _FocusableWrapperState extends State with SingleTickerPr scrollDelta -= (_focusDecorationPadding - projectedItemTop); } + if (!position.maxScrollExtent.isFinite) return; final targetOffset = (currentOffset + scrollDelta).clamp(position.minScrollExtent, position.maxScrollExtent); position.animateTo(targetOffset, duration: const Duration(milliseconds: 200), curve: Curves.easeInOut); diff --git a/lib/screens/libraries/tabs/library_browse_tab.dart b/lib/screens/libraries/tabs/library_browse_tab.dart index 7ca3c99c..1a2e0084 100644 --- a/lib/screens/libraries/tabs/library_browse_tab.dart +++ b/lib/screens/libraries/tabs/library_browse_tab.dart @@ -998,7 +998,12 @@ class _LibraryBrowseTabState extends BaseLibraryTabState