Commit a752435f authored by Per Classon's avatar Per Classon Committed by Flutter GitHub Bot

Exclude modal barrier Container in Drawer from Semantics on Android (#48841)

parent 63016c89
......@@ -542,18 +542,20 @@ class DrawerControllerState extends State<DrawerController> with SingleTickerPro
child: Stack(
children: <Widget>[
BlockSemantics(
child: GestureDetector(
child: ExcludeSemantics(
// On Android, the back button is used to dismiss a modal.
excludeFromSemantics: platformHasBackButton,
onTap: close,
child: Semantics(
label: MaterialLocalizations.of(context)?.modalBarrierDismissLabel,
child: MouseRegion(
opaque: true,
child: Container( // The drawer's "scrim"
color: _scrimColorTween.evaluate(_controller),
excluding: platformHasBackButton,
child: GestureDetector(
onTap: close,
child: Semantics(
label: MaterialLocalizations.of(context)?.modalBarrierDismissLabel,
child: MouseRegion(
opaque: true,
child: Container( // The drawer's "scrim"
color: _scrimColorTween.evaluate(_controller),
),
),
)
),
),
),
),
......
......@@ -328,6 +328,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 100));
expect(semantics, includesNodeWith(actions: <SemanticsAction>[SemanticsAction.tap]));
expect(semantics, includesNodeWith(label: 'Dismiss'));
semantics.dispose();
......@@ -357,6 +358,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 100));
expect(semantics, isNot(includesNodeWith(actions: <SemanticsAction>[SemanticsAction.tap])));
expect(semantics, isNot(includesNodeWith(label: 'Dismiss')));
semantics.dispose();
});
......
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