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:
commit
3c7f7b45cd
5 changed files with 12 additions and 6 deletions
|
@ -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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue