mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
NavigationRail correct traversal order (#173891)
Fix [[VPAT] [A11y] Navigation Rail has unexpected semantics traversal order](https://github.com/flutter/flutter/issues/172992)
This commit is contained in:
parent
a51141a36d
commit
4befa37166
@ -524,28 +524,31 @@ class _NavigationRailState extends State<NavigationRail> with TickerProviderStat
|
||||
mainGroup = SingleChildScrollView(child: mainGroup);
|
||||
}
|
||||
|
||||
return _ExtendedNavigationRailAnimation(
|
||||
animation: _extendedAnimation,
|
||||
child: Semantics(
|
||||
explicitChildNodes: true,
|
||||
child: Material(
|
||||
elevation: elevation,
|
||||
color: backgroundColor,
|
||||
child: SafeArea(
|
||||
right: isRTLDirection,
|
||||
left: !isRTLDirection,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_verticalSpacer,
|
||||
if (widget.leadingAtTop && widget.leading != null) ...<Widget>[
|
||||
widget.leading!,
|
||||
return Semantics(
|
||||
container: true,
|
||||
child: _ExtendedNavigationRailAnimation(
|
||||
animation: _extendedAnimation,
|
||||
child: Semantics(
|
||||
explicitChildNodes: true,
|
||||
child: Material(
|
||||
elevation: elevation,
|
||||
color: backgroundColor,
|
||||
child: SafeArea(
|
||||
right: isRTLDirection,
|
||||
left: !isRTLDirection,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
_verticalSpacer,
|
||||
if (widget.leadingAtTop && widget.leading != null) ...<Widget>[
|
||||
widget.leading!,
|
||||
_verticalSpacer,
|
||||
],
|
||||
Flexible(
|
||||
child: Align(alignment: Alignment(0, groupAlignment), child: mainGroup),
|
||||
),
|
||||
if (widget.trailingAtBottom && widget.trailing != null) widget.trailing!,
|
||||
],
|
||||
Flexible(
|
||||
child: Align(alignment: Alignment(0, groupAlignment), child: mainGroup),
|
||||
),
|
||||
if (widget.trailingAtBottom && widget.trailing != null) widget.trailing!,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -6201,7 +6201,7 @@ TestSemantics _expectedSemantics({bool scrollable = false}) {
|
||||
TestSemantics(
|
||||
flags: <SemanticsFlag>[SemanticsFlag.scopesRoute],
|
||||
children: <TestSemantics>[
|
||||
...destinations,
|
||||
TestSemantics(children: destinations),
|
||||
TestSemantics(label: 'body', textDirection: TextDirection.ltr),
|
||||
],
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user