Fix clearing search result when closing search box
This commit is contained in:
parent
bd73739343
commit
ad3ac339cf
|
@ -261,6 +261,12 @@
|
|||
focusActiveSearchResult(searchResult && searchResult.activeItem)
|
||||
}
|
||||
|
||||
function clearSearchResult () {
|
||||
showSearch = false
|
||||
searchText = ''
|
||||
searchResult = search(doc, searchText, searchResult)
|
||||
}
|
||||
|
||||
function previousSearchResult () {
|
||||
searchResult = searchPrevious(searchResult)
|
||||
focusActiveSearchResult(searchResult && searchResult.activeItem)
|
||||
|
@ -517,10 +523,7 @@
|
|||
onChange={changeSearchText}
|
||||
onNext={nextSearchResult}
|
||||
onPrevious={previousSearchResult}
|
||||
onClose={() => {
|
||||
showSearch = false
|
||||
searchText = ''
|
||||
}}
|
||||
onClose={clearSearchResult}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in New Issue