Skip to content

Commit

Permalink
docs: update search (#1902)
Browse files Browse the repository at this point in the history
Followup to #1889
  • Loading branch information
XhmikosR authored Dec 17, 2023
1 parent b9564a9 commit 6d8e947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import Fuse from 'fuse.js'

function search(searchTerm) {
const trimmedSearchTerm = searchTerm ? searchTerm.trim() : ''
const searchResult = fuse.search(trimmedSearchTerm)

iconListContainer.innerHTML = ''
if (trimmedSearchTerm.length > 0) {
const searchResult = fuse.search(trimmedSearchTerm)
const resultElements = searchResult.map(result => iconElementList[result.refIndex])
iconListContainer.append(...resultElements)
} else {
Expand Down

0 comments on commit 6d8e947

Please sign in to comment.