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

onCommit 3 times #12

Open
jdleung opened this issue Oct 6, 2021 · 0 comments
Open

onCommit 3 times #12

jdleung opened this issue Oct 6, 2021 · 0 comments

Comments

@jdleung
Copy link

jdleung commented Oct 6, 2021

Need to update variables when 'onCommit' is called, it's called only once when press keyboard key 'Return', but 3 times when click outside TextField. How to fix this? Thanks.

`
TextField("", text: $listTitle)
     { isEditing in
           
      } onCommit: {
          // do update things 3 times here
     }.firstResponder(id: FirstResponders.name, firstResponder: $firstResponder, resignableUserOperations: .all)
`
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

No branches or pull requests

1 participant