mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
fix: combobox closing race
This commit is contained in:
@@ -559,7 +559,11 @@ async function updateDropdownPosition() {
|
|||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
const triggerRect = effectiveTriggerEl.value.getBoundingClientRect()
|
const trigger = effectiveTriggerEl.value
|
||||||
|
const dropdown = dropdownRef.value
|
||||||
|
if (!isOpen.value || !trigger || !dropdown) return
|
||||||
|
|
||||||
|
const triggerRect = trigger.getBoundingClientRect()
|
||||||
const width = resolveDropdownWidth(triggerRect.width)
|
const width = resolveDropdownWidth(triggerRect.width)
|
||||||
const minWidth = resolveCssSize(props.dropdownMinWidth) ?? '0px'
|
const minWidth = resolveCssSize(props.dropdownMinWidth) ?? '0px'
|
||||||
|
|
||||||
@@ -571,7 +575,10 @@ async function updateDropdownPosition() {
|
|||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
const dropdownRect = dropdownRef.value.getBoundingClientRect()
|
const positionedDropdown = dropdownRef.value
|
||||||
|
if (!isOpen.value || !positionedDropdown) return
|
||||||
|
|
||||||
|
const dropdownRect = positionedDropdown.getBoundingClientRect()
|
||||||
const viewport = getViewportRect()
|
const viewport = getViewportRect()
|
||||||
|
|
||||||
const direction = determineOpenDirection(triggerRect, dropdownRect, viewport)
|
const direction = determineOpenDirection(triggerRect, dropdownRect, viewport)
|
||||||
|
|||||||
Reference in New Issue
Block a user