Mijick / PopupView

Popups presentation made simple (SwiftUI)
MIT License
1.08k stars 42 forks source link

PopupView seems to follow the component with the biggest width in the view? #69

Closed Nathan1258 closed 6 months ago

Nathan1258 commented 6 months ago

Popup seems to follow the component with the biggest width in the view?

Screenshot 2024-01-23 at 23 25 59

it works as expected when content overflows to the next line

Screenshot 2024-01-23 at 23 27 16

Code:

` import MijickPopupView import SwiftUI

  struct BottomCustomPopup: BottomPopup {
      func createContent() -> some View {
          HStack(spacing: 0) {
              Text("Witaj okrutny świecie")
              Spacer()
              Button(action: dismiss) { Text("Dismiss") }
          }
          .padding(.vertical, 20)
          .padding(.leading, 24)
          .padding(.trailing, 16)
      }
      func configurePopup(popup: BottomPopupConfig) -> BottomPopupConfig {
          popup
              .horizontalPadding(20)
              .bottomPadding(42)
              .cornerRadius(16)
              .tapOutsideToDismiss(true)
              .dragGestureEnabled(true)
              .contentIgnoresSafeArea(true)
      }
  }

`

FulcrumOne commented 6 months ago

Hey, @Nathan1258!

It seems to me that you put modifier implementPopupView in the wrong place. Could you please show me where you inserted it?

Thanks!

Nathan1258 commented 6 months ago

Hi, @FulcrumOne

I've put it at the @main call:


import SwiftUI
import MijickPopupView

@main
struct OverloadApp: App {

    var body: some Scene {
        WindowGroup {
            Splash().implementPopupView()
        }
    }
}
FulcrumOne commented 6 months ago

Yeah, I have just checked and you are right. However, the bug is expected to be fixed in the patch-2.2.3 branch Could you confirm that everything works as expected there?

Nathan1258 commented 6 months ago

Yeah, I have just checked and you are right. However, the bug is expected to be fixed in the patch-2.2.3 branch

Could you confirm that everything works as expected there?

Hi. Sorry for the delayed response. Yes I can confirm this branch has a fix for the issue. Thank you!