Delegate clearing the input to new controller

This commit is contained in:
Adrien Maston
2026-03-02 14:21:32 +01:00
parent 8a1a18562c
commit 340d9aa763
3 changed files with 29 additions and 7 deletions
+2 -5
View File
@@ -22,11 +22,8 @@ export default class extends Controller {
this.#hideItem(this.searchTarget)
}
clearInput() {
if (this.searchInputTarget.value) {
this.searchInputTarget.value = ""
this.searchInputTarget.focus()
} else {
clearInput(event) {
if (event.detail.isAlreadyEmpty) {
this.reset()
}
}