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

Documentation of useTextEditingController with useEffect needs to be updated #325

Open
AhmedLSayed9 opened this issue Aug 19, 2022 · 0 comments
Assignees

Comments

@AhmedLSayed9
Copy link
Contributor

Hello,

The doc of useTextEditingController suggests using useEffect to update the TextEditingController.text whenever a provided ValueListenable changes.

But, When the provided ValueListenable updates the TextEditingController.text for the second time it'll throw an exception:
setState() or markNeedsBuild() called during build

Suggestion:
Delaying the update by a frame using Future.microtask inside useEffect fixes the issue.

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

No branches or pull requests

2 participants