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

Focus state doesn't work as described in the Building SyncUps Tutorial #3071

Closed
3 tasks done
tomassliz opened this issue May 10, 2024 · 0 comments · Fixed by #3072
Closed
3 tasks done

Focus state doesn't work as described in the Building SyncUps Tutorial #3071

tomassliz opened this issue May 10, 2024 · 0 comments · Fixed by #3072
Labels
bug Something isn't working due to a bug in the library.

Comments

@tomassliz
Copy link
Contributor

tomassliz commented May 10, 2024

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
@tomassliz tomassliz added the bug Something isn't working due to a bug in the library. label May 10, 2024
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