Hide textarea off-screen when not composing

Fixes #209
This commit is contained in:
Daniel Imms
2016-07-28 11:13:24 -07:00
parent 65b2be7831
commit e6fd1381ce
+5 -2
View File
@@ -303,6 +303,9 @@
* IME helper dialog is positioned correctly). * IME helper dialog is positioned correctly).
*/ */
CompositionHelper.prototype.updateCompositionElements = function() { CompositionHelper.prototype.updateCompositionElements = function() {
if (!this.isComposing) {
return;
}
var cursor = this.terminal.element.querySelector('.terminal-cursor'); var cursor = this.terminal.element.querySelector('.terminal-cursor');
if (cursor) { if (cursor) {
this.compositionView.style.left = cursor.offsetLeft + 'px'; this.compositionView.style.left = cursor.offsetLeft + 'px';
@@ -317,8 +320,8 @@
* @private * @private
*/ */
CompositionHelper.prototype.clearTextareaPosition = function() { CompositionHelper.prototype.clearTextareaPosition = function() {
this.textarea.style.left = undefined; this.textarea.style.left = '';
this.textarea.style.top = undefined; this.textarea.style.top = '';
} }