Skip to content

Commit

Permalink
Use on() instead of bind()
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin From committed Aug 13, 2013
1 parent 1ab9b18 commit b059b42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jquery.autosize.input.js
Expand Up @@ -13,7 +13,7 @@ var Plugins;
});
$("body").append(this._mirror);

this._input.bind("keydown keyup input", function (e) {
this._input.on("keydown keyup input propertychange change", function (e) {
_this.update();
});

Expand Down
5 changes: 3 additions & 2 deletions jquery.autosize.input.ts
Expand Up @@ -40,8 +40,9 @@ module Plugins
// IE 9 need keydown to keep updating while deleting (keeping backspace in - else it will first update when backspace is released)
// IE 9 need keyup incase text is selected and backspace/deleted is hit - keydown is to early
// How to fix problem with hitting the delete "X" in the box - but not updating!? mouseup is apparently to early
// Could bind separatly and set timer
this._input.bind("keydown keyup input", (e) => { this.update(); });
// Could bind separatly and set timer
// Add so it automatically updates if value of input is changed http://stackoverflow.com/a/1848414/58524
this._input.on("keydown keyup input propertychange change", (e) => { this.update(); });

// Update
() => { this.update(); } ();
Expand Down

0 comments on commit b059b42

Please sign in to comment.