Skip to content

Presenting multiple children from a feature #3369

@ysmaliak

Description

@ysmaliak

Description

There is a bug in the modal presentation behavior when replacing child views. Specifically:

  1. When a modal is presented.
  2. The modal displays a first child.
  3. An attempt is made to replace the first child with a second child.

The replacement operation is not working as expected. The behavior is inconsistent and incorrect, resulting in improper display or failure to update the modal's content.

Note: this is a UIKit project.

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

The first child should be dismissed, and the second child should be presented.

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-09.at.18.00.02.mp4

Actual behavior

Sometimes (randomly), the parent modal is dismissed when trying to present the second child.

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-09.at.17.59.49.mp4

Steps to reproduce

  1. Present Parent as a modal.
  2. Present the First Child as a modal from the Parent.
  3. Tap a button on the First Child; the Parent should be able to receive this action from the delegate and replace the destination with a Second Child.

Sample project: https://github.com/ysmaliak/tca-navigation-test

The Composable Architecture version information

1.14.0

Destination operating system

iOS 17.5

Xcode version information

15.4

Swift Compiler version information

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions