Skip to content

Commit 7847be3

Browse files
committed
pull out all handler
1 parent 32806fe commit 7847be3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/code-editor/src/SearchPanel/SearchPanel.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ export function SearchPanel({
177177
updateSelectedIndex();
178178
}, [view, updateSelectedIndex]);
179179

180+
const handleFindAll = useCallback(() => {
181+
selectMatches(view);
182+
updateSelectedIndex();
183+
}, [view, updateSelectedIndex]);
184+
180185
const handleReplace = useCallback(() => {
181186
replaceNext(view);
182187
updateSelectedIndex();
@@ -312,10 +317,7 @@ export function SearchPanel({
312317
<Button
313318
className={allButtonStyles}
314319
disabled={!searchString || findCount === 0}
315-
onClick={() => {
316-
selectMatches(view);
317-
setSelectedIndex(null);
318-
}}
320+
onClick={handleFindAll}
319321
baseFontSize={baseFontSizeProp || baseFontSize}
320322
darkMode={darkMode}
321323
>

0 commit comments

Comments
 (0)