diff --git a/src/tabcomplete.js b/src/tabcomplete.js index b3f414f..7bd75c0 100644 --- a/src/tabcomplete.js +++ b/src/tabcomplete.js @@ -225,6 +225,16 @@ .insertBefore(input); clone.css({ position: "absolute", + borderColor: "transparent" + }); + input.on("scroll.tabcomplete", function() { + clone.scrollTop(input.scrollTop()).scrollLeft(input.scrollLeft()); + }); + input.on("mousemove.tabcomplete mouseup.tabcomplete", function() { + clone.css({width: input.css("width"), height: input.css("height")}); + if (input.options.wrapInput) { + clone.parent().css({height: input.css("height")}); + } }); } @@ -234,7 +244,7 @@ hint = value + word.substr(value.split(/ |\n/).pop().length); } - clone.val(hint); + clone.val(hint).scrollTop(input.scrollTop()).scrollLeft(input.scrollLeft()); } // Hint by selecting part of the suggested word.