1
1
Fork 0

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
commit 3c7f7b45cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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){