Skip to content

Nodes Stuck at opacity 0 when animating #98

Description

@hhennies

I've found this small bug while making a search bar and trying to animate the elements showing up and going away. I've reproduced the bug in the minimal view. When the user press the button it should show all 3 items, but they get stuck with opacity: 0. This happens both in debug and release builds (release builds are using embedded swift)


@View
struct ContentView {
  @State var show: Bool = false

  var body: some View {
    div {
      button { "Show" }.onClick { show = true }
      if show {
        ForEach(["A", "B", "C"], key: \.self) { item in
          p { item }.transition(.fade)
        }
      }
    }
    .animation(.smooth, value: show)
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions