From ac8db6e8ec0bcf4115c05e48d401e8b2c9ed77a2 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 13 Jul 2016 20:52:55 -0700 Subject: [PATCH] jsdoc handleAnyTextareaChanges --- src/xterm.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 27ce0450..d3b500ae 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -239,12 +239,17 @@ } } + /** + * Apply any changes made to the textarea after the current event chain is allowed to complete. + * This should be called when not currently composing but a keydown event with the "composition + * character" (229) is triggered, in order to allow non-composition text to be entered when an + * IME is active. + */ CompositionHelper.prototype.handleAnyTextareaChanges = function() { var oldValue = this.textarea.value; - var self = this; setTimeout(function() { - // Ensure no composition has started since the timeout + // Ignore if a composition has started since the timeout if (!self.isComposing) { var newValue = self.textarea.value; var diff = newValue.replace(oldValue, '');