Open kf6gpe opened 4 years ago
The documentation in the code says:
// When isDense is true, reduce the height of this button from _kMenuItemHeight to
// _kDenseButtonHeight, but don't make it smaller than the text that it contains.
// Similarly, we don't reduce the height of the button so much that its icon
// would be clipped.
However, with the following snippet:
DropdownButtonFormField(
items: [
DropdownMenuItem(
value: 'some value',
child: Text(
'some option',
style: Theme.of(context).textTheme.headline1,
),
),
],
value: _value,
onChanged: (newValue) { _setValue(newValue); },
isDense: true,
hint: Text(
'some hint',
style: Theme.of(context).textTheme.headline1,
),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(),
),
),
Both 'some hint' and 'some option'(after being selected) will be cut.
DropdownButtonFormField(
items: [
DropdownMenuItem(
value: 'some value',
child: Text(
'some option',
style: Theme.of(context).textTheme.headline1,
),
),
],
value: _value,
onChanged: (newValue) { _setValue(newValue); },
isDense: true,
hint: Text(
'some hint',
style: Theme.of(context).textTheme.headline1,
),
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(),
),
),
I was able to reproduce in 1.21.0-1.0.pre
.
Reproducible as of stable 3.0.1 and master 3.1.0, DropdownButton doesn't change its height based on the selected content.
Same issue
https://b.corp.google.com/issues/151121131.