Unverified Commit 4df55087 authored by Markus Aksli's avatar Markus Aksli Committed by GitHub

InkResponse enable if onTapDown is not null (#96224)

parent 56a7c97f
......@@ -1032,7 +1032,7 @@ class _InkResponseState extends State<_InkResponseStateWidget>
}
bool _isWidgetEnabled(_InkResponseStateWidget widget) {
return widget.onTap != null || widget.onDoubleTap != null || widget.onLongPress != null;
return widget.onTap != null || widget.onDoubleTap != null || widget.onLongPress != null || widget.onTapDown != null;
}
bool get enabled => _isWidgetEnabled(widget);
......
......@@ -76,6 +76,26 @@ void main() {
expect(log, equals(<String>['tap-down', 'tap-cancel']));
});
testWidgets('InkWell only onTapDown enables gestures', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/96030
bool downTapped = false;
await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr,
child: Material(
child: Center(
child: InkWell(
onTapDown: (TapDownDetails details) {
downTapped = true;
},
),
),
),
));
await tester.tap(find.byType(InkWell));
expect(downTapped, true);
});
testWidgets('InkWell invokes activation actions when expected', (WidgetTester tester) async {
final List<String> log = <String>[];
......
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