quanshousio / ToastUI

A simple way to show toast in SwiftUI.
MIT License
561 stars 45 forks source link

Status bar change to light content after Toast dismissed #39

Open thomas-gogox opened 1 month ago

thomas-gogox commented 1 month ago

Pre-requisites:

Expected Behavior

The status bar color scheme should not be changed after toast dismissed

Current Behavior

The status bar is in dark content when the app is running on dark mode with a light background. When the toast is shown, the status bar changes to light content

Steps to Reproduce

https://github.com/user-attachments/assets/0c006b42-136e-45eb-a1bd-8eb79aa29c05

struct TestView: View {
    @State private var isLoading: Bool = false
    var body: some View {
        VStack {
            Button {
                isLoading = true
            } label: {
                Text("Hello World")
                    .padding()
            }
        }
        .toast(isPresented: $isLoading, dismissAfter: 2) {
            ToastView("Loading").toastViewStyle(.indeterminate)
        }
        .frame(
            minWidth: 0,
            maxWidth: .infinity,
            minHeight: 0,
            maxHeight: .infinity,
            alignment: .topLeading
        )
        .background(Color.white.ignoresSafeArea())
        .preferredColorScheme(.dark)
    }
}

Context

I want to keep the status bar color scheme after toast was dismissed.

Your Environment

quanshousio commented 1 month ago

Hi @thomas-gogox,

Thank you for your detailed report. I will look into this. Could you please confirm whether you are using the latest ToastUI version 4.0.0?

mthuong commented 1 month ago

Hi @thomas-gogox,

Thank you for your detailed report. I will look into this. Could you please confirm whether you are using the latest ToastUI version 4.0.0?

I'm using the latest ToastUI version 4.0.0 @quanshousio