diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index d7961996d9..83b43a9be1 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -487,6 +487,7 @@ class ScrollableState extends State with TickerProviderStateMixin child: new IgnorePointer( key: _ignorePointerKey, ignoring: _shouldIgnorePointer, + ignoringSemantics: false, child: new _ScrollableScope( scrollable: this, position: position, diff --git a/packages/flutter/test/widgets/keep_alive_test.dart b/packages/flutter/test/widgets/keep_alive_test.dart index 0a1b75d2c4..baf455d8a9 100644 --- a/packages/flutter/test/widgets/keep_alive_test.dart +++ b/packages/flutter/test/widgets/keep_alive_test.dart @@ -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: (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: (can use size)\n' diff --git a/packages/flutter/test/widgets/scrollable_semantics_test.dart b/packages/flutter/test/widgets/scrollable_semantics_test.dart index c5406cd76d..df4d185c0a 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_test.dart @@ -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 children = []; + 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 flingUp(WidgetTester tester, { int repetitions: 1 }) async {