Skip to content
Snippets Groups Projects
Commit c46e77b9 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

Keep distinction between label and match

parent 88b3cc0a
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
let hits = [] let hits = []
response.data.forEach((item, i) => { response.data.forEach((item, i) => {
let hit = {q: q, label: item[0]} let hit = {q: q, match: item[0], label: item[0]}
hit.lang = item[1][1] ? "bm, nn" : {"bob": "bm", "nob": "nn"}[item[1][0]] hit.lang = item[1][1] ? "bm, nn" : {"bob": "bm", "nob": "nn"}[item[1][0]]
hits.push(hit) hits.push(hit)
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
if (item) { if (item) {
if (typeof item === 'string') { // if blurred without selecting an option if (typeof item === 'string') { // if blurred without selecting an option
// TODO: sett timeout for å vente på siste forslag? // TODO: sett timeout for å vente på siste forslag?
item = {q: item} item = {q: item, label: item}
} }
if (item.q == this.$refs.autocomplete.searchInput) { if (item.q == this.$refs.autocomplete.searchInput) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment