mirror of
https://github.com/amir20/dozzle.git
synced 2026-01-03 11:35:00 +01:00
fix: uses getBoundingClientRect
This commit is contained in:
@@ -18,9 +18,10 @@ let trigger: HTMLElement | null = $ref(null);
|
||||
|
||||
function onMouseEnter(e: MouseEvent) {
|
||||
show.value = true;
|
||||
if (e.target && content) {
|
||||
const x = e.target.offsetLeft + e.target.offsetWidth + 10;
|
||||
const y = e.target.offsetTop;
|
||||
if (e.target && content && e.target instanceof Element) {
|
||||
const box = e.target.getBoundingClientRect();
|
||||
const x = box.left + box.width + 10;
|
||||
const y = box.top;
|
||||
|
||||
content.style.left = `${x}px`;
|
||||
content.style.top = `${y}px`;
|
||||
|
||||
Reference in New Issue
Block a user