Fix dropdown alternating position: reset style.left before measuring getBoundingClientRect

This commit is contained in:
2026-03-11 18:31:36 -04:00
parent 757f85808f
commit 2b596173b6

View File

@@ -3,6 +3,7 @@
activeIndex = -1;
$nextTick(() => {
let dropdown = $refs.dropdown;
dropdown.style.left = '';
let rect = dropdown.getBoundingClientRect();
let windowWidth = window.innerWidth;
dropdown.style.left = rect.right > windowWidth ? `-${rect.width - 40}px` : '0';