Skip to content

Commit

Permalink
Fix onConfirm
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinssa committed Feb 3, 2025
1 parent 391f56f commit bfdcbca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/frontend/controllers/address_autocomplete_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const fetchOptions = async (query, searchUrl) => {
const response = await fetch(`${searchUrl}?query=${encodeURIComponent(query)}`)
const data = await response.json()
console.log(data)
console.log("Test 004")
return data
}

Expand Down Expand Up @@ -50,8 +51,10 @@ export default class extends Controller {
placeholder: 'Start typing to search',
templates: { suggestion: (value) => value },
onConfirm: (val) => {
const selectedResult = Array.from(selectEl.options).find(option => option.address === val)
console.log({val})
const selectedResult = Array.from(selectEl.options).find(option => option.text === val)

console.log({selectedResult})
if (selectedResult) {
selectedResult.selected = true
}
Expand Down

0 comments on commit bfdcbca

Please sign in to comment.