Skip to content

Commit 999d089

Browse files
committed
fix: transform overlay to make underneath of the signature help clickable
Fixes #49
1 parent 1674ed3 commit 999d089

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/signature-help-manager.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,18 +309,22 @@ module.exports = class SignatureHelpManager {
309309
// move box above the current editing line
310310
// HACK: patch the decoration's style so it is shown above the current line
311311
setTimeout(() => {
312+
const overlay = view.element.parentElement
313+
if (!overlay) {
314+
return
315+
}
312316
const hight = view.element.getBoundingClientRect().height
313317
const lineHight = editor.getLineHeightInPixels()
314318
const availableHight = (position.row - editor.getFirstVisibleScreenRow()) * lineHight
315319
if (hight < availableHight + 80) {
316-
view.element.style.bottom = lineHight + hight + "px"
320+
overlay.style.transform = `translateY(-${lineHight + hight}px)`
317321
} else {
318322
// move right so it does not overlap with auto-complete-list
319323
const autoCompleteList = editor.getElement().querySelector("autocomplete-suggestion-list")
320324
if (autoCompleteList) {
321-
view.element.style.left = autoCompleteList.clientWidth + "px"
325+
overlay.style.transform = `translateX(${autoCompleteList.clientWidth}px)`
322326
} else {
323-
view.element.style.left = "300px"
327+
overlay.style.transform = "translateX(300px)"
324328
}
325329
}
326330
view.element.style.visibility = "visible"

0 commit comments

Comments
 (0)