Commit ecb56927 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Show accessibility frame while scrolling (#12039)

* Show accessibility frame while scrolling

* ++

* fix test
parent 3ee1495c
......@@ -487,6 +487,7 @@ class ScrollableState extends State<Scrollable> with TickerProviderStateMixin
child: new IgnorePointer(
key: _ignorePointerKey,
ignoring: _shouldIgnorePointer,
ignoringSemantics: false,
child: new _ScrollableScope(
scrollable: this,
position: position,
......
......@@ -239,7 +239,7 @@ void main() {
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
' │ ignoring: false\n'
' │ ignoringSemantics: implicitly false\n'
' │ ignoringSemantics: false\n'
' │\n'
' └─child: RenderViewport#00000\n'
' │ parentData: <none> (can use size)\n'
......@@ -344,7 +344,7 @@ void main() {
' │ constraints: BoxConstraints(w=800.0, h=600.0)\n'
' │ size: Size(800.0, 600.0)\n'
' │ ignoring: false\n'
' │ ignoringSemantics: implicitly false\n'
' │ ignoringSemantics: false\n'
' │\n'
' └─child: RenderViewport#00000\n'
' │ parentData: <none> (can use size)\n'
......
......@@ -226,6 +226,33 @@ void main() {
semantics.dispose();
});
testWidgets('Semantics tree is populated mid-scroll', (WidgetTester tester) async {
final SemanticsTester semantics = new SemanticsTester(tester);
final List<Widget> children = <Widget>[];
for (int i = 0; i < 80; i++)
children.add(new Container(
child: new Text('Item $i'),
height: 40.0,
));
await tester.pumpWidget(
new Directionality(
textDirection: TextDirection.ltr,
child: new ListView(children: children),
),
);
final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(ListView)));
await gesture.moveBy(const Offset(0.0, -40.0));
await tester.pump();
expect(semantics, includesNodeWith(label: 'Item 1'));
expect(semantics, includesNodeWith(label: 'Item 2'));
expect(semantics, includesNodeWith(label: 'Item 3'));
semantics.dispose();
});
}
Future<Null> flingUp(WidgetTester tester, { int repetitions: 1 }) async {
......
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