Skip to content
This repository was archived by the owner on Jun 7, 2022. It is now read-only.
This repository was archived by the owner on Jun 7, 2022. It is now read-only.

add background color when BottomSheet open #18

@X901

Description

@X901

Hi,
I think it's important to have background color on BottomSheet

I tried to add it like this

 func body(content: Content) -> some View {
        ZStack {
        content
            .onChange(of: isPresented, perform: updatePresentation)
            .onChange(of: selectedDetentIdentifier, perform: updateSelectedDetentIdentifier)
            
            if isPresented {
             Color.black.opacity(0.5).ignoresSafeArea()
                    .animation(.easeIn, value: isPresented)
            }
        }
    }

But I notice it take awhile until the background disappeared after bottomSheet closed
is there a better way to do it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions