1
1
Fork 0

Prevents Enter from submitting the jot form in the ACL search field

- Disable browser autocomplete in jot ACL search field
This commit is contained in:
Hypolite Petovan 2019-08-25 21:03:29 -04:00
parent 341046e3a0
commit cba40dc9fd
3 changed files with 10 additions and 3 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){

View file

@ -1,6 +1,6 @@
<div id="acl-wrapper">
<input id="acl-search">
<input id="acl-search" autocomplete="off">
<a id="acl-showall">{{$showall}}</a>
<div id="acl-list">
<div id="acl-list-content">

View file

@ -4,7 +4,7 @@
<button id="acl-showall" class="btn btn-block btn-default"><i class="fa fa-globe"></i> {{$showall}}</button>
</div>
<div class="form-group form-group-search">
<input type="text" id="acl-search" class="form-control form-search">
<input type="text" id="acl-search" class="form-control form-search" autocomplete="off">
</div>
<div id="acl-list">
<div id="acl-list-content"></div>