Fix DropdownMenuFormField does not clear text field content on reset …#174937
Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom Sep 8, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where DropdownMenuFormField failed to clear its text content when reset with a null initialSelection. The approach of introducing a local TextEditingController when one isn't provided is sound, and its lifecycle seems to be managed correctly in didUpdateWidget and dispose. The new regression tests are well-written and cover both cases with and without a provided controller. I've found one minor issue in the new tests regarding resource management.
3d299f5 to
abf1ddc
Compare
justinmc
approved these changes
Sep 5, 2025
Contributor
justinmc
left a comment
There was a problem hiding this comment.
LGTM with a nit. Thank you Bruno!
abf1ddc to
909d6d7
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 8, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 8, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 8, 2025
This was referenced Sep 8, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Sep 8, 2025
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Sep 8, 2025
flutter/flutter@87d5b75...973320c 2025-09-08 [email protected] Roll Fuchsia Linux SDK from V_KooYFGRmGm6JrqM... to m7Qmvj5wtfPlMA8i8... (flutter/flutter#175067) 2025-09-08 [email protected] Roll Packages from cab2ac2 to 24588c6 (1 revision) (flutter/flutter#175070) 2025-09-08 [email protected] Roll Skia from e1a200e25998 to 0c2b0a00b7b5 (1 revision) (flutter/flutter#175065) 2025-09-08 [email protected] Roll Dart SDK from c7518d480c73 to 83c6b6124380 (1 revision) (flutter/flutter#175064) 2025-09-08 [email protected] Roll Skia from 87ee27220133 to e1a200e25998 (4 revisions) (flutter/flutter#175061) 2025-09-08 [email protected] [ Widget Preview ] Improve `--machine` output (flutter/flutter#175003) 2025-09-08 [email protected] Fix DropdownMenuFormField does not clear text field content on reset … (flutter/flutter#174937) 2025-09-08 [email protected] Roll Skia from 310062ae6aee to 87ee27220133 (1 revision) (flutter/flutter#175051) 2025-09-08 [email protected] Roll Dart SDK from 34cd2b4b56dd to c7518d480c73 (1 revision) (flutter/flutter#175049) 2025-09-07 [email protected] Roll Skia from b00ca433657b to 310062ae6aee (1 revision) (flutter/flutter#175046) 2025-09-07 [email protected] Roll Fuchsia Linux SDK from LRAtLJWUiZNmSVShG... to V_KooYFGRmGm6JrqM... (flutter/flutter#175040) 2025-09-07 [email protected] Roll Skia from 064cf12ad0cc to b00ca433657b (1 revision) (flutter/flutter#175028) 2025-09-06 [email protected] Roll Fuchsia Linux SDK from xG_uERsxHvUwFHpF2... to LRAtLJWUiZNmSVShG... (flutter/flutter#175018) 2025-09-06 [email protected] Roll Dart SDK from f138e58bcf6d to 34cd2b4b56dd (2 revisions) (flutter/flutter#175017) 2025-09-06 [email protected] Roll Skia from 5c60f8a66270 to 064cf12ad0cc (2 revisions) (flutter/flutter#175015) 2025-09-05 [email protected] Roll Skia from f29ea2795934 to 5c60f8a66270 (2 revisions) (flutter/flutter#175010) 2025-09-05 [email protected] Fix SliverMainAxisGroup scrollOffsetCorrection (flutter/flutter#174369) 2025-09-05 [email protected] Roll Skia from 759f406584da to f29ea2795934 (3 revisions) (flutter/flutter#175000) 2025-09-05 [email protected] Roll Dart SDK from 5e3afb74ffdf to f138e58bcf6d (15 revisions) (flutter/flutter#174994) 2025-09-05 [email protected] Roll Packages from 98580c6 to cab2ac2 (2 revisions) (flutter/flutter#174998) 2025-09-05 [email protected] [ios26]fix host engine compile error (flutter/flutter#174723) 2025-09-05 [email protected] Added note about how to compile licenses_cpp (flutter/flutter#174947) 2025-09-05 [email protected] Roll Skia from 845ec125e94c to 759f406584da (3 revisions) (flutter/flutter#174992) 2025-09-05 [email protected] [web] Minor simplification in flutter.js loader (flutter/flutter#174963) 2025-09-05 [email protected] deletes the old license checker. (flutter/flutter#174719) 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],[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
mboetger
pushed a commit
to mboetger/flutter
that referenced
this pull request
Sep 18, 2025
flutter#174937) ## Description This PR fixes `DropdownMenuFormField` not clearing the text field value when the form is reset and DropdownMenuFormField.initialSelection is null. ## Related Issue Fixes [DropdownMenuFormField does not reset when calling FormState.reset](flutter#174578) ## Tests Adds 2 tests.
Jaineel-Mamtora
pushed a commit
to Jaineel-Mamtora/flutter_forked
that referenced
this pull request
Sep 24, 2025
flutter#174937) ## Description This PR fixes `DropdownMenuFormField` not clearing the text field value when the form is reset and DropdownMenuFormField.initialSelection is null. ## Related Issue Fixes [DropdownMenuFormField does not reset when calling FormState.reset](flutter#174578) ## Tests Adds 2 tests.
danferreira
pushed a commit
to danferreira/packages
that referenced
this pull request
Oct 22, 2025
flutter/flutter@87d5b75...973320c 2025-09-08 [email protected] Roll Fuchsia Linux SDK from V_KooYFGRmGm6JrqM... to m7Qmvj5wtfPlMA8i8... (flutter/flutter#175067) 2025-09-08 [email protected] Roll Packages from cab2ac2 to 24588c6 (1 revision) (flutter/flutter#175070) 2025-09-08 [email protected] Roll Skia from e1a200e25998 to 0c2b0a00b7b5 (1 revision) (flutter/flutter#175065) 2025-09-08 [email protected] Roll Dart SDK from c7518d480c73 to 83c6b6124380 (1 revision) (flutter/flutter#175064) 2025-09-08 [email protected] Roll Skia from 87ee27220133 to e1a200e25998 (4 revisions) (flutter/flutter#175061) 2025-09-08 [email protected] [ Widget Preview ] Improve `--machine` output (flutter/flutter#175003) 2025-09-08 [email protected] Fix DropdownMenuFormField does not clear text field content on reset … (flutter/flutter#174937) 2025-09-08 [email protected] Roll Skia from 310062ae6aee to 87ee27220133 (1 revision) (flutter/flutter#175051) 2025-09-08 [email protected] Roll Dart SDK from 34cd2b4b56dd to c7518d480c73 (1 revision) (flutter/flutter#175049) 2025-09-07 [email protected] Roll Skia from b00ca433657b to 310062ae6aee (1 revision) (flutter/flutter#175046) 2025-09-07 [email protected] Roll Fuchsia Linux SDK from LRAtLJWUiZNmSVShG... to V_KooYFGRmGm6JrqM... (flutter/flutter#175040) 2025-09-07 [email protected] Roll Skia from 064cf12ad0cc to b00ca433657b (1 revision) (flutter/flutter#175028) 2025-09-06 [email protected] Roll Fuchsia Linux SDK from xG_uERsxHvUwFHpF2... to LRAtLJWUiZNmSVShG... (flutter/flutter#175018) 2025-09-06 [email protected] Roll Dart SDK from f138e58bcf6d to 34cd2b4b56dd (2 revisions) (flutter/flutter#175017) 2025-09-06 [email protected] Roll Skia from 5c60f8a66270 to 064cf12ad0cc (2 revisions) (flutter/flutter#175015) 2025-09-05 [email protected] Roll Skia from f29ea2795934 to 5c60f8a66270 (2 revisions) (flutter/flutter#175010) 2025-09-05 [email protected] Fix SliverMainAxisGroup scrollOffsetCorrection (flutter/flutter#174369) 2025-09-05 [email protected] Roll Skia from 759f406584da to f29ea2795934 (3 revisions) (flutter/flutter#175000) 2025-09-05 [email protected] Roll Dart SDK from 5e3afb74ffdf to f138e58bcf6d (15 revisions) (flutter/flutter#174994) 2025-09-05 [email protected] Roll Packages from 98580c6 to cab2ac2 (2 revisions) (flutter/flutter#174998) 2025-09-05 [email protected] [ios26]fix host engine compile error (flutter/flutter#174723) 2025-09-05 [email protected] Added note about how to compile licenses_cpp (flutter/flutter#174947) 2025-09-05 [email protected] Roll Skia from 845ec125e94c to 759f406584da (3 revisions) (flutter/flutter#174992) 2025-09-05 [email protected] [web] Minor simplification in flutter.js loader (flutter/flutter#174963) 2025-09-05 [email protected] deletes the old license checker. (flutter/flutter#174719) 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],[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
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 12, 2025
lucaantonelli
pushed a commit
to lucaantonelli/flutter
that referenced
this pull request
Nov 21, 2025
flutter#174937) ## Description This PR fixes `DropdownMenuFormField` not clearing the text field value when the form is reset and DropdownMenuFormField.initialSelection is null. ## Related Issue Fixes [DropdownMenuFormField does not reset when calling FormState.reset](flutter#174578) ## Tests Adds 2 tests.
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
This PR fixes
DropdownMenuFormFieldnot clearing the text field value when the form is reset and DropdownMenuFormField.initialSelection is null.Related Issue
Fixes DropdownMenuFormField does not reset when calling FormState.reset
Tests
Adds 2 tests.