-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: qualityA truly polished experienceA truly polished experiencea: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Use case
Currently, the DropdownMenu widget allows the user to:
- Select an option from the dropdown list (triggering
onSelected). - Type arbitrary text into the input field to perform searching or filtering.
- Tap out of focus and leave the arbitrary text visible without selecting anything or triggering any callbacks.
This is confusing as the text field is the primary feedback for which item has been selected yet it no longer reflects that. See example.
Proposal
I believe the most comprehensive solution would be:
DropdownMenu(
autoSelect: true, // Automatically select highlighted menu item if focus lost
incompleteTextBehavior: // If no highlighted menu item, or autoSelect: false
DropdownIncompleteTextBehavior.ignore, // Leave text as-is, don't emit (current behavior)
or DropdownIncompleteTextBehavior.emit, // Leave text as-is, emit `onSelected(null)`
or DropdownIncompleteTextBehavior.clear, // Clear text, emit `onSelected(null)`
or DropdownIncompleteTextBehavior.reset, // Reset to previous, emit `onSelected(previous)`
)DropdownIncompleteTextBehavior.ignore could then be deprecated with a view to removing in future, forcing the user to do something more sensible.
benthillerkus
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: qualityA truly polished experienceA truly polished experiencea: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team