When ToastMessage on .Top AutoCloses. App no longer honors safe area
Describe the bug When ToastMessage on .Top AutoCloses. App no longer honors safe area
To Reproduce Steps to reproduce the behavior:
-
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))}
-
Let message auto close
-
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
- Before toast
- Toast
- After Toast
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.