Fix clearing search result when closing search box

This commit is contained in:
Jos de Jong 2020-07-26 11:11:46 +02:00
parent bd73739343
commit ad3ac339cf
1 changed files with 7 additions and 4 deletions

View File

@ -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}