File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ function calculatePosition() {
5050
5151 const rect = containerRef .value .getBoundingClientRect ()
5252 dropdownPosition .value = {
53- top: rect .bottom + window . scrollY ,
54- left: rect .left + window . scrollX ,
53+ top: rect .bottom ,
54+ left: rect .left ,
5555 width: rect .width ,
5656 }
5757}
@@ -136,7 +136,7 @@ watchEffect(() => {
136136 left: `${dropdownPosition.left}px`,
137137 width: `${dropdownPosition.width}px`,
138138 }"
139- pos =" absolute "
139+ pos =" fixed "
140140 p =" 2"
141141 m =" t-2"
142142 z =" 10004"
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ function calculatePosition(desiredHeight: number) {
6868 const availableSpace = openUp ? spaceAbove : spaceBelow
6969
7070 dropdownPosition .value = {
71- top: (openUp ? rect .top : rect .bottom ) + window . scrollY ,
72- left: rect .left + window . scrollX ,
71+ top: (openUp ? rect .top : rect .bottom ),
72+ left: rect .left ,
7373 width: rect .width ,
7474 openUp ,
7575 // 极端矮视口下也不能超过实际可用空间,否则仍会溢出贴边
@@ -197,7 +197,7 @@ function onMouseEnter() {
197197 transform: dropdownPosition.openUp ? `translateY(calc(-100% - ${DROPDOWN_MARGIN}px))` : undefined,
198198 marginTop: dropdownPosition.openUp ? undefined : `${DROPDOWN_MARGIN}px`,
199199 }"
200- pos =" absolute " p =" 2"
200+ pos =" fixed " p =" 2"
201201 z =" 10004" flex =" ~ col gap-1"
202202 w =" full" overflow-y-overlay will-change-transform
203203 >
You can’t perform that action at this time.
0 commit comments