align left

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-06-27 13:16:52 -05:00
parent 8dfcb41691
commit 9db5257132

View File

@ -370,7 +370,7 @@ extension DatePicker {
var popoverY: CGFloat = 0
// Calculate horizontal position
if sourceFrameInParent.width < popoverWidth {
if sourceFrameInParent.width <= popoverWidth {
if sourceFrameInParent.midX - popoverWidth / 2 < 0 {
// Align to left
popoverX = sourceFrameInParent.minX
@ -382,7 +382,7 @@ extension DatePicker {
popoverX = sourceFrameInParent.midX - popoverWidth / 2
}
} else {
popoverX = sourceFrameInParent.midX - popoverWidth / 2
popoverX = sourceFrameInParent.minX //sourceFrameInParent.midX - popoverWidth / 2
}
// Ensure the popover is within the parent's bounds horizontally