-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace value on click #433
Comments
Hello @bacloud23, Can you please share more details on what you're trying to achieve and, if possible, your config file? |
I experience the same issue. I copied the basic steps in the docs under screencast.2024-09-04.13-31-37.mp4 |
Hello @DevDuki, Can you please share your configurations? |
@TarekRaafat Hi thank you for your response; const autoCompleteJS = new autoComplete({
selector: '#autoComplete',
placeHolder: 'Recherche rapide...',
data: {
src: async (query) => {
try {
// Fetch Data from external Source
const options = isDevEnv
? { referrerPolicy: 'unsafe-url', credentials: 'include' }
: { credentials: 'include' }
const source = await fetch(`localhost/autocomplete/${query}`, options)
// Data is array of `Objects` | `Strings`
return await source.json()
} catch (error) {
return error
}
},
},
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 = `localhost/keyword/${keyword}`
},
},
},
}) |
@bacloud23 Your selector: '#autoComplete',
placeHolder: 'Recherche rapide...',
data: {
keys: ['_id'], // <-- just add this
src: ......
} |
Hi,
I cannot set the value, when the user clicks on suggestions, value of input is empty, and even the visible input does not reflect the selected (onclick) on suggestion.
Thanks a lot
The text was updated successfully, but these errors were encountered: