diff --git a/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_widget.dart b/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_widget.dart index 8af25c7325..a212692e20 100644 --- a/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_widget.dart +++ b/frontend/appflowy_flutter/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_widget.dart @@ -339,15 +339,11 @@ class _SelectionMenuWidgetState extends State { newSelectedIndex -= 1; } else if (event.logicalKey == LogicalKeyboardKey.arrowDown) { newSelectedIndex += 1; - }else if (event.logicalKey == LogicalKeyboardKey.tab) { + } else if (event.logicalKey == LogicalKeyboardKey.tab) { newSelectedIndex += widget.maxItemInRow; var currRow = (newSelectedIndex) % widget.maxItemInRow; if (newSelectedIndex >= _showingItems.length) { - if (currRow + 1 >= widget.maxItemInRow) { - newSelectedIndex = 0; - } else { - newSelectedIndex = (currRow + 1); - } + newSelectedIndex = (currRow + 1) % widget.maxItemInRow; } }