From e6fd1381ce2e6af32843ca58ecd361ea79da52e7 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 28 Jul 2016 11:13:24 -0700 Subject: [PATCH] Hide textarea off-screen when not composing Fixes #209 --- src/xterm.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xterm.js b/src/xterm.js index 9afc08fd..ddd10ff5 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -303,6 +303,9 @@ * IME helper dialog is positioned correctly). */ CompositionHelper.prototype.updateCompositionElements = function() { + if (!this.isComposing) { + return; + } var cursor = this.terminal.element.querySelector('.terminal-cursor'); if (cursor) { this.compositionView.style.left = cursor.offsetLeft + 'px'; @@ -317,8 +320,8 @@ * @private */ CompositionHelper.prototype.clearTextareaPosition = function() { - this.textarea.style.left = undefined; - this.textarea.style.top = undefined; + this.textarea.style.left = ''; + this.textarea.style.top = ''; }