Skip to content

Alert in SwiftUI-CaseStudies-AlertAndConfirmationDialog is glitch #3272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
PatrickSCLin opened this issue Aug 6, 2024 · 0 comments · Fixed by #3309
Closed
3 tasks done

Alert in SwiftUI-CaseStudies-AlertAndConfirmationDialog is glitch #3272

PatrickSCLin opened this issue Aug 6, 2024 · 0 comments · Fixed by #3309
Labels
bug Something isn't working due to a bug in the library.

Comments

@PatrickSCLin
Copy link

Description

the alert which is inside of .incrementButtonTapped didn't work as expected in Alert mode but ConfirmationDialog was working

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 alert Alert! should be dismissed and then showing the second alert Incremented!

Actual behavior

the first alert Alert! was dismissed but second alert Incremented! didn't pop out

Steps to reproduce

  1. Run the CasesStudies example SwiftUI app
  2. Taps on Alerts and Confirmation Dialogs
  3. Taps on Alert
  4. Taps on Increment on Alert! Alert

The second alert should be shown but it didn't

The Composable Architecture version information

1.12.1

Destination operating system

iOS 17.5

Xcode version information

Version 15.4 (15F31d)

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
@PatrickSCLin PatrickSCLin added the bug Something isn't working due to a bug in the library. label Aug 6, 2024
stephencelis added a commit that referenced this issue Aug 26, 2024
When we added support for vanilla SwiftUI modifiers, we lost the ability
to present one alert after another because `nil` writes to the alert
bindings unconditionally dismissed the feature, even if the feature was
freshly presented.

This fixes things by suppressing dismissal when the identity of a
presented item has changed.

Fix #3272.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working due to a bug in the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant