Unverified Commit 4fd6188d authored by Natalie Sampsell's avatar Natalie Sampsell Committed by GitHub

Fix SegmentedControl accessibility (#19994)

parent ab9f17cb
...@@ -313,6 +313,7 @@ class _SegmentedControlState<T> extends State<SegmentedControl<T>> ...@@ -313,6 +313,7 @@ class _SegmentedControlState<T> extends State<SegmentedControl<T>>
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: textStyle, style: textStyle,
child: new Semantics( child: new Semantics(
button: true,
inMutuallyExclusiveGroup: true, inMutuallyExclusiveGroup: true,
selected: widget.groupValue == currentKey, selected: widget.groupValue == currentKey,
child: child, child: child,
......
...@@ -606,6 +606,7 @@ void main() { ...@@ -606,6 +606,7 @@ void main() {
new TestSemantics.rootChild( new TestSemantics.rootChild(
label: 'Child 1', label: 'Child 1',
flags: <SemanticsFlag>[ flags: <SemanticsFlag>[
SemanticsFlag.isButton,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
SemanticsFlag.isSelected, SemanticsFlag.isSelected,
], ],
...@@ -616,6 +617,7 @@ void main() { ...@@ -616,6 +617,7 @@ void main() {
new TestSemantics.rootChild( new TestSemantics.rootChild(
label: 'Child 2', label: 'Child 2',
flags: <SemanticsFlag>[ flags: <SemanticsFlag>[
SemanticsFlag.isButton,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
], ],
actions: <SemanticsAction>[ actions: <SemanticsAction>[
...@@ -640,6 +642,7 @@ void main() { ...@@ -640,6 +642,7 @@ void main() {
new TestSemantics.rootChild( new TestSemantics.rootChild(
label: 'Child 1', label: 'Child 1',
flags: <SemanticsFlag>[ flags: <SemanticsFlag>[
SemanticsFlag.isButton,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
], ],
actions: <SemanticsAction>[ actions: <SemanticsAction>[
...@@ -649,6 +652,7 @@ void main() { ...@@ -649,6 +652,7 @@ void main() {
new TestSemantics.rootChild( new TestSemantics.rootChild(
label: 'Child 2', label: 'Child 2',
flags: <SemanticsFlag>[ flags: <SemanticsFlag>[
SemanticsFlag.isButton,
SemanticsFlag.isInMutuallyExclusiveGroup, SemanticsFlag.isInMutuallyExclusiveGroup,
SemanticsFlag.isSelected, SemanticsFlag.isSelected,
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment