File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export function SearchDocumentation(props: { id: DocID; quickSearch?: string })
1111 const tags = useMemo ( ( ) => Object . keys ( currentDocs ) , [ currentDocs ] ) ;
1212 const [ searchText , setSearchText ] = useState ( props . quickSearch || "" ) ;
1313 const [ searchTag , setSearchTag ] = useState < Tags > ( tags [ 0 ] as Tags ) ;
14- const [ currentIdx , setCurrentIdx ] = useState ( 0 ) ;
14+ const [ currentIdx , setCurrentIdx ] = useState < string | null > ( null ) ;
1515 const currentAPI = currentDocs [ searchTag ] ! ;
1616
1717 let isLoading = false ;
@@ -47,19 +47,19 @@ export function SearchDocumentation(props: { id: DocID; quickSearch?: string })
4747 throttle = { true }
4848 navigationTitle = { DocID [ props . id ] || "No Title" }
4949 isLoading = { isLoading || searchResults === undefined }
50- isShowingDetail = { searchResults ?. [ currentIdx ] ?. content != undefined }
50+ isShowingDetail = { searchResults . find ( ( item ) => item . id === currentIdx ) ?. content != undefined }
5151 onSearchTextChange = { setSearchText }
5252 searchText = { searchText }
5353 onSelectionChange = { ( id ) => {
54- setCurrentIdx ( parseInt ( id || "0" ) ) ;
54+ setCurrentIdx ( id || "0" ) ;
5555 } }
5656 searchBarAccessory = {
5757 < List . Dropdown
5858 tooltip = "Select Tag"
5959 storeValue
6060 onChange = { ( tag ) => {
6161 setSearchTag ( tag as Tags ) ;
62- setCurrentIdx ( 0 ) ;
62+ setCurrentIdx ( null ) ;
6363 } }
6464 >
6565 { tags . map ( ( tag ) => (
You can’t perform that action at this time.
0 commit comments