-
-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Additional spaces between characters.
I'm using the latest version, with the following code:
export const setupAutoComplete = async () => {
const autoCompleteJS = new autoComplete({
selector: '#autoComplete',
placeHolder: 'Quick search...',
data: {
src: async (query) => {
try {
const source = await fetch(`${consts.APIHost[process.env.NODE_ENV]}/autocomplete/${query}`)
return await source.json()
} catch (error) {
return error
}
},
// Data 'Object' key to be searched
keys: ['_id'],
},
cache: true,
debounce: 300,
searchEngine: 'loose',
diacritics: true,
maxResults: 15,
threshold: 3,
resultItem: {
highlight: true,
},
events: {
input: {
selection: (event) => {
const selection = event.detail.selection.value
const keyword = selection._id
autoCompleteJS.input.value = keyword
window.location.href = `${consts.APIHost[process.env.NODE_ENV]}/keyword/${keyword}`
},
},
},
})
}Thanks a lot for this beautiful library.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working