app/components/solidus_admin/ui/forms/search/component.js in solidus_admin-0.2.0 vs app/components/solidus_admin/ui/forms/search/component.js in solidus_admin-0.3.0
- old
+ new
@@ -93,11 +93,11 @@
this.renderedHtml = resultsHtml
this.resultsTarget.innerHTML = resultsHtml
}
if (this.openResults && resultsHtml && this.query) {
- if (!this.resultsTarget.parentNode.open) this.selectedIndex = 0
+ if (this.resultsTarget.parentNode.classList.contains("hidden")) this.selectedIndex = 0
for (const result of this.resultTargets) {
if (result === this.selectedResult) {
if (!result.hasAttribute("aria-selected") && result.scrollIntoViewIfNeeded) {
// This is a non-standard method, but it's supported by all major browsers
@@ -106,11 +106,11 @@
result.setAttribute("aria-selected", true)
} else {
result.removeAttribute("aria-selected")
}
}
- this.resultsTarget.parentNode.open = true
+ this.resultsTarget.parentNode.classList.remove("hidden")
} else {
- this.resultsTarget.parentNode.open = false
+ this.resultsTarget.parentNode.classList.add("hidden")
}
}
}