Ability to close search when input is empty

This commit is contained in:
Andy Smith
2025-11-21 15:17:17 -06:00
parent 250935530f
commit d61bff7321
+6 -2
View File
@@ -23,8 +23,12 @@ export default class extends Controller {
}
clearInput() {
this.searchInputTarget.value = ""
this.searchInputTarget.focus()
if (this.searchInputTarget.value) {
this.searchInputTarget.value = ""
this.searchInputTarget.focus()
} else {
this.reset()
}
}
showModalAndSubmit(event) {