From 64d11a9dda9dd8a251f1130cfe2bfeb7321085e7 Mon Sep 17 00:00:00 2001 From: csf Date: Wed, 26 Oct 2022 21:02:20 +0900 Subject: [PATCH] fix cm tabs scroll action --- flutter/lib/desktop/widgets/tabbar_widget.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index 9c88575ec..edc9fd352 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -127,12 +127,12 @@ class DesktopTabController { if (!isDesktop || index < 0) return; state.update((val) { val!.selected = index; - Future.delayed(Duration.zero, (() { + Future.delayed(Duration(milliseconds: 100), (() { if (val.pageController.hasClients) { val.pageController.jumpToPage(index); } + val.scrollController.itemCount = val.tabs.length; if (val.scrollController.hasClients && - val.scrollController.canScroll && val.scrollController.itemCount > index) { val.scrollController .scrollToItem(index, center: false, animate: true);