Correct autocomplete using rendered geometry
This commit is contained in:
@@ -380,12 +380,11 @@ function configure(node) {
|
||||
});
|
||||
panel.append(menu);
|
||||
menu.style.left = `${Math.max(5, (suggestionLayer?.offsetLeft || 0) + 4)}px`;
|
||||
const panelRect = panel.getBoundingClientRect();
|
||||
const promptFrameRect = promptFrame?.getBoundingClientRect();
|
||||
const promptTop = promptFrameRect && panelRect
|
||||
? promptFrameRect.top - panelRect.top
|
||||
: (suggestionLayer?.offsetTop || 0);
|
||||
menu.style.top = `${Math.max(5, promptTop)}px`;
|
||||
const menuRect = menu.getBoundingClientRect();
|
||||
if (promptFrameRect && menuRect) {
|
||||
menu.style.transform = `translateY(${promptFrameRect.top - menuRect.top}px)`;
|
||||
}
|
||||
autocomplete = menu;
|
||||
};
|
||||
prompt.oninput = () => { rememberPromptSelection(); promptText = prompt.value; clip.prompt = prompt.value; };
|
||||
|
||||
Reference in New Issue
Block a user