diff --git a/_posts/2015-07-24-autocomplete-trie.md b/_posts/2015-07-24-autocomplete-trie.md index 1ad91be..8e9b8ba 100644 --- a/_posts/2015-07-24-autocomplete-trie.md +++ b/_posts/2015-07-24-autocomplete-trie.md @@ -176,7 +176,7 @@ input.addEventListener('keyup', () => { for (let node of nodes) { // << Change const category = node.category ? `- ${node.category}` : ''; - results.innerHTML += `
  • ${node.name} ${category}
  • `; + results.innerHTML += `
  • ${node.value} ${category}
  • `; } }); {% endhighlight %} @@ -195,7 +195,7 @@ input.addEventListener('keydown', e => { if (!current.children.length) return; - input.value = current.children[0].name; + input.value = current.children[0].value; } }); {% endhighlight %}