-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: 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.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
issue
The hint widget isn't wrapped with _DropdownMenuItemContainer when selectedItemBuilder is set.
flutter/packages/flutter/lib/src/material/dropdown.dart
Lines 1399 to 1404 in 8c67684
| if (widget.hint != null || (!_enabled && widget.disabledHint != null)) { | |
| Widget displayedHint = _enabled ? widget.hint! : widget.disabledHint ?? widget.hint!; | |
| if (widget.selectedItemBuilder == null) { | |
| displayedHint = _DropdownMenuItemContainer(alignment: widget.alignment, child: displayedHint); | |
| } | |
this causes the hint widget to have a float effect.

dartpad demo: https://dartpad.dev/?id=f31fae9f27d88f616522d15ef71777bc
I believe selectedItemBuilder should only affect the selected menu item. Since hint can't be selected, it should still be wrapped to the default DropdownMenuItemContainer.
proposal
displayedHint to be always wrapped with DropdownMenuItemContainer
Metadata
Metadata
Assignees
Labels
c: 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.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Type
Projects
Status
Done (PR merged)