[autocomplete] specify exact position

This commit is contained in:
Shish 2023-12-26 03:18:31 +00:00
parent 5f69545b65
commit 0eef0cc42b

View file

@ -110,7 +110,10 @@ function renderCompletions(element) {
// insert the completion block after the element
if(element.parentNode) {
element.parentNode.insertBefore(completions_el, element.nextSibling);
completions_el.style.width = element.clientWidth + 'px';
let br = element.getBoundingClientRect();
completions_el.style.width = br.width + 'px';
completions_el.style.left = br.left + 'px';
completions_el.style.top = (br.top + br.height) + 'px';
}
}
/**