Skip to content

Commit

Permalink
Merge pull request #337 from zsimo/master
Browse files Browse the repository at this point in the history
prevent to make an ajax call on copy and paste
  • Loading branch information
bassjobsen authored Jan 20, 2018
2 parents 2f18eef + c9ca700 commit 87bfc40
Show file tree
Hide file tree
Showing 4 changed files with 1,051 additions and 2 deletions.
9 changes: 9 additions & 0 deletions bootstrap3-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,15 @@
},

keydown: function (e) {
/**
* Prevent to make an ajax call while copying and pasting.
*
* @author Simone Sacchi
* @version 2018/01/18
*/
if (e.keyCode === 17) { // ctrl
return;
}
this.keyPressed = true;
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]);
if (!this.shown && e.keyCode == 40) {
Expand Down
Loading

0 comments on commit 87bfc40

Please sign in to comment.