Exclude modal barrier Container in Drawer from Semantics on Android (#48841)
This commit is contained in:
parent
63016c8900
commit
a752435fac
@ -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();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user