diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index e4def8b1..397a0917 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -374,9 +374,12 @@ var TextInput = function(parentNode, host) { resetSelection(host.selection.isEmpty()); host._emit("nativecontextmenu", {target: host}); var rect = host.container.getBoundingClientRect(); + var style = dom.computedStyle(host.container); + var top = rect.top + (parseInt(style.borderTopWidth) || 0); + var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); var move = function(e) { - text.style.left = e.clientX - rect.left - 2 + "px"; - text.style.top = e.clientY - rect.top - 2 + "px"; + text.style.left = e.clientX - left - 2 + "px"; + text.style.top = e.clientY - top - 2 + "px"; }; move(e);