You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DropdownButtonFormField is using the key for an option multiple times #103266
@TahaTesser I think that by "expected" you are judging what the code does. The key being reused somewhere else the user intended is not really what I would qualify as "expected". If I want to test the click on an option of the menu, I expect it to work with the key like I would for virtually everything else. Calling it expected is quite a leap and it still looks like it's wrong to me even if it was intended.
Activity
danagbemava-nc commentedon May 9, 2022
Issue is reproducible on
stableandmaster.Repo attached below for easy access.
The source code is on the
dropdown_selection_keysbranch.test_log.txt
flutter doctor -v
flutter_repros.zip
TahaTesser commentedon May 10, 2022
This is expected.
DropdownMenuItem is used in the selected menu and also passed to the popup menu without manipulation hence keys are also passed to the menu
flutter/packages/flutter/lib/src/material/dropdown.dart
Line 1272 in dfb4ff2
You can use
.firstor.lastto determine which item you're looking for.cedvdb commentedon May 10, 2022
@TahaTesser I think that by "expected" you are judging what the code does. The key being reused somewhere else the user intended is not really what I would qualify as "expected". If I want to test the click on an option of the menu, I expect it to work with the key like I would for virtually everything else. Calling it expected is quite a leap and it still looks like it's wrong to me even if it was intended.
Why not copy it with a different key ?
10 remaining items
flutter-triage-bot commentedon Nov 6, 2023
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.HansMuller commentedon Nov 22, 2023
As of Flutter 3.16, DropdownMenu is preferred and does not have the problem described here.