TextEditingValue default selection docs#96245
Merged
justinmc merged 1 commit intoflutter:masterfrom Jan 10, 2022
Merged
Conversation
LongCatIsLooong
approved these changes
Jan 7, 2022
auto-submit bot
pushed a commit
that referenced
this pull request
Feb 14, 2024
…143452) ## Description This PR adds more documentation for `TextEditingController(String text)` constructor and it adds one example. #96245 was a first improvement to the documentation. #79495 tried to hide the cursor when an invalid selection is set but it was reverted. #123777 mitigated the issue of having a default invalid selection: it takes care of setting a proper selection when a text field is focused and its controller selection is not initialized. I will try changing the initial selection in another PR, but It will probably break several existing tests. ## Related Issue Fixes #95978 ## Tests Adds 1 test for the new example.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR simply adds some docs about TextEditingValue's default selection, which is collapsed at index -1. This selection value of -1 is a constant source of problems in Flutter, but if we can't eliminate it for now, we need to clearly document what it is.
Partial fix for #95978