Skip to content

Commit ebcf1ea

Browse files
fix: clean up stale active
1 parent 4e13af3 commit ebcf1ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/webview/SearchSidebar/SearchResultList/useListState.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const collapseMap = new Map<string, boolean>()
1616

1717
onResultChange(() => {
1818
collapseMap.clear()
19+
lastActiveFile = ''
1920
})
2021

2122
export function useToggleResult(filePath: string) {
@@ -24,6 +25,7 @@ export function useToggleResult(filePath: string) {
2425
const toggleIsExpanded = useCallback(() => {
2526
toggleResult(filePath)
2627
toggle()
28+
// jump to toggled files, only if it is at the top
2729
if (isExpanded && lastActiveFile === filePath) {
2830
const index = findIndex(filePath)
2931
if (index) {

0 commit comments

Comments
 (0)