Merge pull request #7565 from MrPetovan/bug/7406-neutralize-enter-in-autocomplete

Prevents Enter from submitting forms in ACL fields
This commit is contained in:
Michael Vogel
2019-08-26 11:37:38 +02:00
committed by GitHub
5 changed files with 12 additions and 6 deletions

View File

@@ -109,7 +109,14 @@ ACL.prototype.search = function(){
ACL.prototype.on_search = function(event){
if (this.kp_timer) clearTimeout(this.kp_timer);
this.kp_timer = setTimeout( this.search.bind(this), 1000);
// Triggers an immediate search while preventing form submission
if (event.key === 'Enter') {
this.search();
event.preventDefault();
} else {
this.kp_timer = setTimeout( this.search.bind(this), 500);
}
};
ACL.prototype.on_showall = function(event){