Fix DropdownMenu throwing TextEditingController disposed error on select#139385
Merged
auto-submit[bot] merged 4 commits intoDec 5, 2023
Conversation
8 tasks
7976ac7 to
34d7114
Compare
gspencergoog
commented
Dec 1, 2023
Contributor
Author
There was a problem hiding this comment.
Part of the problem here was that the text editing controller that was passed in was being captured by the closure, rather than being accessed new each time, so it would capture an instance that was no longer current. There's no need to pass it in, since it's a member of the state class.
gspencergoog
commented
Dec 1, 2023
Contributor
Author
There was a problem hiding this comment.
The old code wasn't handling the case where the widget got a new controller later on. It would just ignore any controller that was set later, and continue using the one it originally constructed.
b675af2 to
a03462c
Compare
DropdownMenu throwing TextEditingController disposed error on select
QuncCccccc
approved these changes
Dec 5, 2023
Contributor
QuncCccccc
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the fix!
Merged
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 5, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 5, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 5, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 5, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 5, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 5, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 6, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 6, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 6, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 6, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 6, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 6, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 7, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 7, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 7, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 7, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 7, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 7, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Dec 8, 2023
…error on select (flutter/flutter#139385)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 16, 2024
…error on select (flutter/flutter#139385)
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.
Description
When a DropdownMenu exists within another menu and a MenuItem is selected, the
TextEditingControllerof the DropdownMenu is used after it has been disposed.This PR manages the local
TextControllerinstance better, making sure that the one used when building is the current one, and handling the case where thecontrolleris set on the widget after initial creation.Also, places where we were setting the text and selection separately were converted to use
TextEditingValueand set the value atomically.Related Issues
Tests