Skip to content

Commit

Permalink
fix issue with search
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons committed Oct 31, 2024
1 parent 5985f2c commit ca58c54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/autosuggest/autosuggest.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ export default class AutosuggestUI {
listElement.className = classAutosuggestOption;
listElement.setAttribute('id', `${this.listboxId}__option--${index}`);
listElement.setAttribute('role', 'option');
if (result.category) {
if (result.item.category) {
innerHTML =
innerHTML +
`<span class="ons-autosuggest__category ons-u-lighter ons-u-fs-s ons-u-db">${result.category}</span>`;
`<span class="ons-autosuggest__category ons-u-lighter ons-u-fs-s ons-u-db">${result.item.category}</span>`;
}
listElement.innerHTML = innerHTML;
listElement.addEventListener('click', () => {
Expand Down Expand Up @@ -508,9 +508,9 @@ export default class AutosuggestUI {
if (this.allowMultiple === 'true') {
let value = this.storeExistingSelections(result.item[this.lang]);
result.displayText = value;
} else if (result.url) {
} else if (result.item.url) {
result.displayText = result.item[this.lang];
window.location = result.url;
window.location = result.item.url;
} else {
result.displayText = result.item[this.lang];
}
Expand Down

0 comments on commit ca58c54

Please sign in to comment.