diff --git a/querybook/webapp/components/SearchAndReplace/CodeMirrorSearchHighlighter.tsx b/querybook/webapp/components/SearchAndReplace/CodeMirrorSearchHighlighter.tsx index 12b660a72..cec20aad7 100644 --- a/querybook/webapp/components/SearchAndReplace/CodeMirrorSearchHighlighter.tsx +++ b/querybook/webapp/components/SearchAndReplace/CodeMirrorSearchHighlighter.tsx @@ -61,7 +61,7 @@ export const CodeMirrorSearchHighlighter: React.FC<{ } ); } - }, [currentSearchResultIndex]); + }, [currentSearchItem]); return null; }; diff --git a/querybook/webapp/components/SearchAndReplace/SearchAndReplaceBar.tsx b/querybook/webapp/components/SearchAndReplace/SearchAndReplaceBar.tsx index 5fc3cdafa..e72a1952d 100644 --- a/querybook/webapp/components/SearchAndReplace/SearchAndReplaceBar.tsx +++ b/querybook/webapp/components/SearchAndReplace/SearchAndReplaceBar.tsx @@ -142,16 +142,12 @@ export const SearchAndReplaceBar = React.forwardRef< })); const noPrevRes = React.useMemo( - () => - searchResults.length === 0 || - currentSearchResultIndex <= searchResults.length, - [searchResults.length, currentSearchResultIndex] + () => searchResults.length <= 1, + [searchResults.length] ); const noNextRes = React.useMemo( - () => - searchResults.length === 0 || - currentSearchResultIndex >= searchResults.length, - [searchResults.length, currentSearchResultIndex] + () => searchResults.length <= 1, + [searchResults.length] ); const searchRow = (