fix tab sheet scroll logic
This commit is contained in:
+4
-6
@@ -456,13 +456,10 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
||||
);
|
||||
|
||||
final lastScroll = useRef<String?>(null);
|
||||
final scrollControllerIsAttached = useListenableSelector(
|
||||
sheetScrollController,
|
||||
() => sheetScrollController.hasClients,
|
||||
);
|
||||
|
||||
useEffect(() {
|
||||
if (scrollControllerIsAttached) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (sheetScrollController.hasClients) {
|
||||
if (lastScroll.value != activeTab) {
|
||||
final index = filteredTabEntities.value.indexWhere(
|
||||
(entity) => entity.tabId == activeTab,
|
||||
@@ -485,9 +482,10 @@ class ViewTabsSheetWidget extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return null;
|
||||
}, [filteredTabEntities, activeTab, scrollControllerIsAttached]);
|
||||
}, [filteredTabEntities, activeTab]);
|
||||
|
||||
final tabs = useMemoized(() {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user