SSToastMessage icon indicating copy to clipboard operation
SSToastMessage copied to clipboard

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

Open dstrickland67 opened this issue 3 years ago • 0 comments

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.

dstrickland67 avatar May 28 '22 19:05 dstrickland67