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

When ToastMessage on .Top AutoCloses. App no longer honors safe area #6

Open
dstrickland67 opened this issue May 28, 2022 · 0 comments

Comments

@dstrickland67
Copy link

Describe the bug
When ToastMessage on .Top AutoCloses. App no longer honors safe area

To Reproduce
Steps to reproduce the behavior:

  1. Present toast (copied directly from sample on github).
    .present(isPresented: $showSubmitConfirmation, type: .toast, position: .top, autohideDuration: 6, closeOnTap: true) {
    /// create your own view for toast
    self.createTopToastView()
    }
    func createTopToastView() -> some View {
    VStack {
    Spacer(minLength: 20)
    HStack() {
    Image("mike")
    .resizable()
    .aspectRatio(contentMode: ContentMode.fill)
    .frame(width: 50, height: 50)
    .cornerRadius(25)

             VStack(alignment: .leading, spacing: 2) {
                 HStack {
                     Text("Mike")
                         .foregroundColor(.white)
                         .fontWeight(.bold)
                     Spacer()
                     Text("10:10")
                         .font(.system(size: 12))
                         .foregroundColor(Color(red: 0.9, green: 0.9, blue: 0.9))
                 }
    
                 Text("Hey, Don't miss the WWDC on tonight at 10 AM PST.")
                     .lineLimit(2)
                     .font(.system(size: 14))
                     .foregroundColor(.white)
             }
         }.padding(15)
     }
     .frame(width: UIScreen.main.bounds.width, height: 110)
     .background(Color(red: 0.85, green: 0.65, blue: 0.56))
    

    }

  2. Let message auto close

  3. top line of app is now inside unsafe area. It is almost like the app is changing the main window to unsafe and not back when done.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

  1. Before toast
    image
  2. Toast
    image
  3. After Toast
    image

Smartphone (please complete the following information):

  • Device: iPad mini 15.5 (simulator)
  • OS:IOS 15.5

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant