diff --git a/src/App.tsx b/src/App.tsx index b605309..1093978 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -394,22 +394,24 @@ export default function App() { const getNextTextSortOrder = useCallback( (folderId: string | null) => { + if (hasSearch) return null; const list = textsByFolder.get(folderId ?? null) ?? []; const hasManualOrder = list.some((text) => text.sort_order !== null); if (!hasManualOrder) return null; return list.length; }, - [textsByFolder] + [hasSearch, textsByFolder] ); const getNextFolderSortOrder = useCallback( (parentId: string | null) => { + if (hasSearch) return null; const list = foldersByParent.get(parentId ?? null) ?? []; const hasManualOrder = list.some((folder) => folder.sort_order !== null); if (!hasManualOrder) return null; return list.length; }, - [foldersByParent] + [foldersByParent, hasSearch] ); const isFolderExpanded = useCallback(