fix: handle uppercase in fuzzy search mode

This commit is contained in:
EnixCoda 2022-07-17 22:46:01 +08:00
parent ebcae23ba1
commit 7e10717566

View file

@ -18,13 +18,10 @@ export const fuzzyMode: ModeShape = {
}
},
renderNodeLabelText(node, searchKey) {
const { name, path } = node
const { name } = node
const path = hasUpperCase(searchKey) ? node.path : node.path.toLowerCase()
const indexes = fuzzyMatchIndexes(
searchKey.toLowerCase(),
path.toLowerCase(),
path.length - name.length,
)
const indexes = fuzzyMatchIndexes(searchKey, path, path.length - name.length)
const chunks = name.split('/')
let progress = 0
return chunks.map((chunk, index, chunks) => {