Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Content alignment in Popup does not work #172

Open
2 tasks done
amirsaam opened this issue Jan 27, 2025 · 0 comments
Open
2 tasks done

[BUG]: Content alignment in Popup does not work #172

amirsaam opened this issue Jan 27, 2025 · 0 comments
Assignees
Labels

Comments

@amirsaam
Copy link

amirsaam commented Jan 27, 2025

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

  1. Create some TopPopup with a VStack .leading or .trailing alignment
  2. Call the popup in a View
  3. 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

@amirsaam amirsaam added the bug label Jan 27, 2025
@amirsaam amirsaam changed the title [BUG] [BUG]: Content alignment in Popup does not work Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants