File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
packages/dropdown_button2 Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 7
7
- Implement switch expressions.
8
8
- Fix memory leak in CurvedAnimation [ Flutter core] .
9
9
- Avoid Container objects when possible for better performance [ Flutter core] .
10
+ - Add semantics to dropdown menu items [ Flutter core] .
10
11
11
12
## 3.0.0-beta.21
12
13
Original file line number Diff line number Diff line change @@ -882,8 +882,10 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>>
882
882
);
883
883
}
884
884
885
+ final bool childHasButtonSemantic = hintIndex != null ||
886
+ (_selectedIndex != null && widget.selectedItemBuilder == null );
885
887
return Semantics (
886
- button: true ,
888
+ button: ! childHasButtonSemantic ,
887
889
child: Actions (
888
890
actions: _actionMap,
889
891
child: InkWell (
Original file line number Diff line number Diff line change @@ -111,9 +111,12 @@ class _DropdownMenuItemContainer extends StatelessWidget {
111
111
112
112
@override
113
113
Widget build (BuildContext context) {
114
- return SizedBox (
115
- height: intrinsicHeight ? null : height,
116
- child: Align (alignment: alignment, child: child),
114
+ return Semantics (
115
+ button: true ,
116
+ child: SizedBox (
117
+ height: intrinsicHeight ? null : height,
118
+ child: Align (alignment: alignment, child: child),
119
+ ),
117
120
);
118
121
}
119
122
}
You can’t perform that action at this time.
0 commit comments