Skip to content
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

Allow Binding<Case?> to write into nil #54

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Conversation

stephencelis
Copy link
Member

We recently prevented Binding.init?(unwrapping:case:) from changing the case, which makes sense because it's a failable initializer and we don't want ghost bindings to be able to write back into the system once the value goes nil. This includes a SwiftUI bug where text fields that are focused during dismissal can write into the binding, effectively un-dismissing the binding.

I think we applied the same logic to Binding.case, though, but I do not think that's what we want to do, and it actually caused a regression.

Fixes #53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Binding.case(_:) modifier behavior changed unexpectedly in v0.4.x
2 participants