diff --git a/lib/screens/channel/chat/stores/chat_tabs_store.dart b/lib/screens/channel/chat/stores/chat_tabs_store.dart index 0fc54c46..8d3f1c8d 100644 --- a/lib/screens/channel/chat/stores/chat_tabs_store.dart +++ b/lib/screens/channel/chat/stores/chat_tabs_store.dart @@ -620,10 +620,8 @@ abstract class ChatTabsStoreBase with Store { // Primary tab (index 0) cannot be moved, and nothing can move before it if (oldIndex == 0 || newIndex == 0) return; - // ReorderableListView passes newIndex as if item was already removed - if (oldIndex < newIndex) { - newIndex -= 1; - } + // onReorderItem already adjusts newIndex for the removed item, so no + // manual off-by-one correction is needed here. if (oldIndex == newIndex) return; final tab = _tabs.removeAt(oldIndex); diff --git a/lib/screens/channel/chat/widgets/chat_tabs.dart b/lib/screens/channel/chat/widgets/chat_tabs.dart index 500831b4..fe946202 100644 --- a/lib/screens/channel/chat/widgets/chat_tabs.dart +++ b/lib/screens/channel/chat/widgets/chat_tabs.dart @@ -144,7 +144,7 @@ class ChatTabs extends StatelessWidget { left: 12, right: showMerge ? 32 : 12, ), - onReorder: (oldIndex, newIndex) { + onReorderItem: (oldIndex, newIndex) { HapticFeedback.lightImpact(); chatTabsStore.reorderTab(oldIndex, newIndex); },