Skip to content

Commit 0459040

Browse files
committed
Completer.js: Add auto submit capability
1 parent 3e8867c commit 0459040

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

asset/js/widget/Completer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ define(["../notjQuery"], function ($) {
290290
input.title = data[name];
291291
}
292292
}
293+
294+
if (this.shouldAutoSubmit()) {
295+
$(input.form).trigger('submit', { submittedBy: input });
296+
}
293297
}
294298

295299
this.hideSuggestions();
@@ -456,6 +460,10 @@ define(["../notjQuery"], function ($) {
456460
}
457461
}
458462

463+
shouldAutoSubmit() {
464+
return 'autoSubmit' in this.input.dataset;
465+
}
466+
459467
/**
460468
* Event listeners
461469
*/

0 commit comments

Comments
 (0)