From 1ec0bac9c66b58eb56d2679aff6c83733ddcc9f2 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 22 Oct 2016 15:41:55 -0700 Subject: [PATCH] Keep composition textarea within viewport Part of #299 --- src/CompositionHelper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CompositionHelper.js b/src/CompositionHelper.js index 76399494..9d24dbc3 100644 --- a/src/CompositionHelper.js +++ b/src/CompositionHelper.js @@ -182,7 +182,8 @@ CompositionHelper.prototype.updateCompositionElements = function(dontRecurse) { this.compositionView.style.top = cursor.offsetTop + 'px'; var compositionViewBounds = this.compositionView.getBoundingClientRect(); this.textarea.style.left = cursor.offsetLeft + compositionViewBounds.width + 'px'; - this.textarea.style.top = (cursor.offsetTop + cursor.offsetHeight) + 'px'; + this.textarea.style.top = cursor.offsetTop + 'px'; + this.textarea.style.bottom = (cursor.offsetTop + cursor.offsetHeight) + 'px'; } if (!dontRecurse) { setTimeout(this.updateCompositionElements.bind(this, true), 0);