-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Update TextEditingController.text documentation to recommend against using it in production code
#157769
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
Merged
auto-submit
merged 4 commits into
flutter:master
from
LongCatIsLooong:TextEditingController-text-setter-test-only
Jan 10, 2025
Merged
Update TextEditingController.text documentation to recommend against using it in production code
#157769
auto-submit
merged 4 commits into
flutter:master
from
LongCatIsLooong:TextEditingController-text-setter-test-only
Jan 10, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `TextEditingController.text` setter has been a major source of confusion, as using it would usually result in loss of cursor position if the text field is active. Argubly it also should not be part of the controller's interface since it is a convenience method. There are many issues, for example: flutter#65547
…ller-text-setter-test-only
Contributor
Author
|
Some takeaways from the errors I got from marking
|
TextEditingController.text setter as @visibleForTestingTextEditingController.text documentation to recommend against using it in production code
victorsanni
approved these changes
Jan 8, 2025
goderbauer
approved these changes
Jan 9, 2025
Member
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Contributor
|
@LongCatIsLooong Sorry to bug you while you're out, but if this shouldn't be merged, please let me know! Otherwise I'll probably go ahead and merge this next week or so. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 11, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 11, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 12, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 12, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 13, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 13, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jan 13, 2025
…d against using it in production code (flutter/flutter#157769)
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Jan 13, 2025
flutter/flutter@864d4f5...72db8f6 2025-01-13 [email protected] Roll Packages from 6554751 to 3c3bc68 (16 revisions) (flutter/flutter#161515) 2025-01-13 [email protected] Update error message for when leading/trailing width exceeds `ListTile` width and add missing test (flutter/flutter#161091) 2025-01-13 [email protected] Deprecate unused `ButtonStyleButton.iconAlignment` property (flutter/flutter#160023) 2025-01-12 [email protected] Provide monitor information. (flutter/flutter#161359) 2025-01-11 [email protected] [android_engine_test] Remove background/foreground from surface texture trampoline test. (flutter/flutter#161441) 2025-01-11 [email protected] Remove some miscellaneous references to Cirrus. (flutter/flutter#161390) 2025-01-11 [email protected] add semantics role and tab (flutter/flutter#161260) 2025-01-10 [email protected] CupertinoSheetRoute (flutter/flutter#157568) 2025-01-10 [email protected] Update `TextEditingController.text` documentation to recommend against using it in production code (flutter/flutter#157769) 2025-01-10 [email protected] � [tool] Add a wirelessly connected device name as `displayName` (flutter/flutter#160497) 2025-01-10 [email protected] FixForward: method was renamed (flutter/flutter#161431) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
maheshj01
pushed a commit
to maheshj01/flutter
that referenced
this pull request
Jan 15, 2025
…t using it in production code (flutter#157769) The `TextEditingController.text` setter has been a major source of confusion, as using it would usually result in loss of cursor position if the text field is active. Arguably it also should not be part of the controller's interface since it is a convenience method. There are many issues, for example: flutter#65547 ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 12, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 6, 2025
…d against using it in production code (flutter/flutter#157769)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 7, 2025
…d against using it in production code (flutter/flutter#157769)
androidseb
pushed a commit
to androidseb/packages
that referenced
this pull request
Jun 8, 2025
flutter/flutter@864d4f5...72db8f6 2025-01-13 [email protected] Roll Packages from 6554751 to 3c3bc68 (16 revisions) (flutter/flutter#161515) 2025-01-13 [email protected] Update error message for when leading/trailing width exceeds `ListTile` width and add missing test (flutter/flutter#161091) 2025-01-13 [email protected] Deprecate unused `ButtonStyleButton.iconAlignment` property (flutter/flutter#160023) 2025-01-12 [email protected] Provide monitor information. (flutter/flutter#161359) 2025-01-11 [email protected] [android_engine_test] Remove background/foreground from surface texture trampoline test. (flutter/flutter#161441) 2025-01-11 [email protected] Remove some miscellaneous references to Cirrus. (flutter/flutter#161390) 2025-01-11 [email protected] add semantics role and tab (flutter/flutter#161260) 2025-01-10 [email protected] CupertinoSheetRoute (flutter/flutter#157568) 2025-01-10 [email protected] Update `TextEditingController.text` documentation to recommend against using it in production code (flutter/flutter#157769) 2025-01-10 [email protected] � [tool] Add a wirelessly connected device name as `displayName` (flutter/flutter#160497) 2025-01-10 [email protected] FixForward: method was renamed (flutter/flutter#161431) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
FMorschel
pushed a commit
to FMorschel/packages
that referenced
this pull request
Jun 9, 2025
flutter/flutter@864d4f5...72db8f6 2025-01-13 [email protected] Roll Packages from 6554751 to 3c3bc68 (16 revisions) (flutter/flutter#161515) 2025-01-13 [email protected] Update error message for when leading/trailing width exceeds `ListTile` width and add missing test (flutter/flutter#161091) 2025-01-13 [email protected] Deprecate unused `ButtonStyleButton.iconAlignment` property (flutter/flutter#160023) 2025-01-12 [email protected] Provide monitor information. (flutter/flutter#161359) 2025-01-11 [email protected] [android_engine_test] Remove background/foreground from surface texture trampoline test. (flutter/flutter#161441) 2025-01-11 [email protected] Remove some miscellaneous references to Cirrus. (flutter/flutter#161390) 2025-01-11 [email protected] add semantics role and tab (flutter/flutter#161260) 2025-01-10 [email protected] CupertinoSheetRoute (flutter/flutter#157568) 2025-01-10 [email protected] Update `TextEditingController.text` documentation to recommend against using it in production code (flutter/flutter#157769) 2025-01-10 [email protected] � [tool] Add a wirelessly connected device name as `displayName` (flutter/flutter#160497) 2025-01-10 [email protected] FixForward: method was renamed (flutter/flutter#161431) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
a: text input
Entering text in a text field or keyboard related problems
f: cupertino
flutter/packages/flutter/cupertino repository
f: material design
flutter/packages/flutter/material repository.
framework
flutter/packages/flutter repository. See also f: labels.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
TextEditingController.textsetter has been a major source of confusion, as using it would usually result in loss of cursor position if the text field is active. Arguably it also should not be part of the controller's interface since it is a convenience method.There are many issues, for example: #65547
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.