Only submit on blur if the input has a value

This commit is contained in:
Andy Smith
2026-01-21 14:33:19 -06:00
parent 9b1dd0bcd9
commit eccef3b19c
@@ -54,6 +54,10 @@ export default class extends Controller {
}
submitToTopTarget(event) {
const value = event.target.value?.trim()
if (!value) return false
this.element.setAttribute("data-turbo-frame", "_top")
this.submit()
}