Fix dropdown alternating position: reset style.left before measuring getBoundingClientRect
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user