Focus state doesn't work as described in the Building SyncUps Tutorial
Closed this issue · 0 comments
Description
In the Sync-up form part, sections Form focus: an approach & Form focus: a better approach
describe how to implement the focus in the form. First with the logic directly in the view and later with moving this logic into the reducer.
In my case, when I focus the last attendee in the list and remove it, the focus is not set to the nearest attendee in the list. I think the root cause of this issue is the line with guard
condition. It looks like the focus is set to nil
when the user swipes the item in the list.
I checked the SyncUps example project in this repo and it works but it doesn't contain the problematic guard
condition.
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 focus should be set to the nearest attendee.
Actual behavior
The focus is not set to the nearest attendee when the user deletes the last attendee from the list.
The Composable Architecture version information
1.10.3
Destination operating system
iOS 17.4
Xcode version information
Version 15.3 (15E204a)
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