-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: datalossCan result in the user losing their stateCan result in the user losing their statecustomer: quill (g3)f: 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.
Milestone
Description
Internal: b/140830819
Issue
The following screenshot demonstrates the issue.
If the dropdown is open, the items are correctly displayed as - for example - two line items, but if the dropdown is closed, only the first line will be visible, and the dropdown indicator won't be visible.
Steps to Reproduce
See the following test project:
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Test project'),
),
body: new Padding(
padding: new EdgeInsets.all(16.0),
child: new TestStatefulWidget(),
),
),
));
}
class TestStatefulWidget extends StatefulWidget {
@override
State<StatefulWidget> createState() => new TestStatefulWidgetState();
}
class TestStatefulWidgetState extends State<TestStatefulWidget> {
static const List<String> shortItems = const [
'These',
'items',
'are',
'short',
'enough',
];
static const List<String> longItems = const [
'These items will probably be longer than what fits on the screen correctly',
'Because of this, the icon indicator on the right side will not show',
'Instead, in development mode, a red indicator will display, showing something is wrong',
];
String shortSpinnerValue = shortItems[0];
String longSpinnerValue = longItems[0];
@override
Widget build(BuildContext context) {
return new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
new DropdownButton(
value: shortSpinnerValue,
onChanged: (string) => setState(() => shortSpinnerValue = string),
items: shortItems.map((string) {
return new DropdownMenuItem(
child: new Text(string),
value: string,
);
}).toList(),
),
new DropdownButton(
value: longSpinnerValue,
onChanged: (string) => setState(() => longSpinnerValue = string),
items: longItems.map((string) {
return new DropdownMenuItem(
child: new Text(string),
value: string,
);
}).toList(),
),
],
);
}
}maryx, nalin, tedwong, figengungor, hyochan and 18 moreMoatasem1994
Metadata
Metadata
Assignees
Labels
c: datalossCan result in the user losing their stateCan result in the user losing their statecustomer: quill (g3)f: 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.