Only submit on blur if the input has a value
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user