Open
Description
Prerequisites
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
Expected Behavior
When aligning popup's content to .leading
or .trailing
in a VStack
they should be aligned correctly in the Popup.
Current Behavior
When calling the popup, the alignment does not work.
Steps to Reproduce
- Create some TopPopup with a
VStack
.leading
or.trailing
alignment - Call the popup in a View
- The Popup content is aligned to center.
Code Sample
My popup struct:
struct TopCustomPopup: TopPopup {
@Environment(\.colorScheme) var colorScheme
let isError: Bool
let message: LocalizedStringKey
var body: some View {
VStack(alignment: .leading) {
HStack {
ResizableBundledImage(
imageName: isError ? "cross-circled" : "exclamation-triangle",
imageSize: 25,
bundle: .radixUI
)
Text(message)
.font(.custom(.vazir, .caption, .medium))
}
.padding(.horizontal, 7.5)
.padding(.bottom, 7.5)
}
.foregroundStyle(colorScheme == .light ? Color.sand12 : Color.sand2)
.frame(minHeight: 45)
}
func configurePopup(config: TopPopupConfig) -> TopPopupConfig {
config
.cornerRadius(0)
.heightMode(.auto)
}
}
Screenshots
This issue is self explanatory.
Context
SDK 4.0.1
Xcode 16.2
Operating System: iOS 18.2.1
Device: iPhone 12 Pro Max