fix key events for textareas.

This commit is contained in:
Christopher Jeffrey 2015-02-22 13:35:49 -08:00
parent 520dc08100
commit b42308c7cc
1 changed files with 6 additions and 2 deletions

View File

@ -5122,8 +5122,12 @@ Textarea.prototype.readInput = function(callback) {
: callback(null, value);
};
this.__listener = this._listener.bind(this);
this.on('keypress', this.__listener);
// Put this in a nextTick so the current
// key event doesn't trigger any keys input.
nextTick(function() {
self.__listener = self._listener.bind(self);
self.on('keypress', self.__listener);
});
this.__done = this._done.bind(this, null, null);
this.on('blur', this.__done);