Skip to content

Commit 8beca08

Browse files
committed
fix: fix popup can't appear above anchor
1 parent 26f92c9 commit 8beca08

File tree

1 file changed

+2
-2
lines changed
  • miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic

1 file changed

+2
-2
lines changed

miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/ListPopup.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ object ListPopupDefaults {
267267
} else {
268268
anchorBounds.left + popupMargin.left
269269
}
270-
val offsetY = if (windowBounds.height - anchorBounds.height > popupContentSize.height) {
270+
val offsetY = if (windowBounds.bottom - anchorBounds.bottom > popupContentSize.height) {
271271
// Show below
272272
anchorBounds.bottom + popupMargin.bottom
273273
} else if (anchorBounds.top - windowBounds.top > popupContentSize.height) {
@@ -321,7 +321,7 @@ object ListPopupDefaults {
321321
} else {
322322
anchorBounds.left + popupMargin.left
323323
}
324-
offsetY = if (windowBounds.height - anchorBounds.height > popupContentSize.height) {
324+
offsetY = if (windowBounds.bottom - anchorBounds.bottom > popupContentSize.height) {
325325
// Show below
326326
anchorBounds.bottom + popupMargin.bottom
327327
} else if (anchorBounds.top - windowBounds.top > popupContentSize.height) {

0 commit comments

Comments
 (0)