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