diff --git a/lib/signature-help-manager.js b/lib/signature-help-manager.js index 97163f8..e3ad5bd 100644 --- a/lib/signature-help-manager.js +++ b/lib/signature-help-manager.js @@ -309,18 +309,22 @@ module.exports = class SignatureHelpManager { // move box above the current editing line // HACK: patch the decoration's style so it is shown above the current line setTimeout(() => { + const overlay = view.element.parentElement + if (!overlay) { + return + } const hight = view.element.getBoundingClientRect().height const lineHight = editor.getLineHeightInPixels() const availableHight = (position.row - editor.getFirstVisibleScreenRow()) * lineHight if (hight < availableHight + 80) { - view.element.style.bottom = lineHight + hight + "px" + overlay.style.transform = `translateY(-${lineHight + hight}px)` } else { // move right so it does not overlap with auto-complete-list const autoCompleteList = editor.getElement().querySelector("autocomplete-suggestion-list") if (autoCompleteList) { - view.element.style.left = autoCompleteList.clientWidth + "px" + overlay.style.transform = `translateX(${autoCompleteList.clientWidth}px)` } else { - view.element.style.left = "300px" + overlay.style.transform = "translateX(300px)" } } view.element.style.visibility = "visible"