diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 12f80d69db..af7aba9c55 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -751,7 +751,7 @@ class TooltipState extends State with SingleTickerProviderStateMixin { behavior: HitTestBehavior.opaque, onLongPress: (_triggerMode == TooltipTriggerMode.longPress) ? _handlePress : null, onTap: (_triggerMode == TooltipTriggerMode.tap) ? _handleTap : null, - excludeFromSemantics: true, + excludeFromSemantics: _excludeFromSemantics, child: result, ); // Only check for hovering if there is a mouse connected. diff --git a/packages/flutter/test/material/back_button_test.dart b/packages/flutter/test/material/back_button_test.dart index 09d9fd1d66..df7801fb1e 100644 --- a/packages/flutter/test/material/back_button_test.dart +++ b/packages/flutter/test/material/back_button_test.dart @@ -172,6 +172,7 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, + hasLongPressAction: true, isFocusable: true, )); handle.dispose(); @@ -216,6 +217,7 @@ void main() { hasEnabledState: true, isEnabled: true, hasTapAction: true, + hasLongPressAction: true, isFocusable: true, )); handle.dispose(); diff --git a/packages/flutter/test/material/calendar_date_picker_test.dart b/packages/flutter/test/material/calendar_date_picker_test.dart index ac7788206e..fe6d1eb99b 100644 --- a/packages/flutter/test/material/calendar_date_picker_test.dart +++ b/packages/flutter/test/material/calendar_date_picker_test.dart @@ -672,6 +672,7 @@ void main() { tooltip: 'Previous month', isButton: true, hasTapAction: true, + hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -680,6 +681,7 @@ void main() { tooltip: 'Next month', isButton: true, hasTapAction: true, + hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index 27daaf47aa..4d4abbc4ab 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -2047,7 +2047,10 @@ void main() { children: [ TestSemantics( tooltip: 'Delete', - actions: [SemanticsAction.tap], + actions: [ + SemanticsAction.tap, + SemanticsAction.longPress + ], textDirection: TextDirection.ltr, flags: [ SemanticsFlag.isButton, diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index 648080cfad..b6b6bcef53 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -833,6 +833,7 @@ void main() { tooltip: 'Switch to input', isButton: true, hasTapAction: true, + hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, @@ -876,6 +877,7 @@ void main() { tooltip: 'Switch to calendar', isButton: true, hasTapAction: true, + hasLongPressAction: true, isEnabled: true, hasEnabledState: true, isFocusable: true, diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index 3a1827045a..15b4f27c63 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -700,6 +700,7 @@ void main() { tooltip: 'Add Photo', actions: [ SemanticsAction.tap, + SemanticsAction.longPress, ], flags: [ SemanticsFlag.hasEnabledState, diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index 19f03af5d5..a3d1c60eec 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -620,7 +620,10 @@ void main() { SemanticsFlag.isEnabled, SemanticsFlag.isFocusable, ], - actions: [SemanticsAction.tap], + actions: [ + SemanticsAction.tap, + SemanticsAction.longPress, + ], tooltip: 'Back', textDirection: TextDirection.ltr, ), diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart index 5500883eb2..dcb2c66106 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -1418,6 +1418,9 @@ void main() { id: 1, tooltip: 'TIP', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ); @@ -1618,6 +1621,9 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ), diff --git a/packages/flutter/test/material/tooltip_theme_test.dart b/packages/flutter/test/material/tooltip_theme_test.dart index 4595bda8d5..d26a8d31a2 100644 --- a/packages/flutter/test/material/tooltip_theme_test.dart +++ b/packages/flutter/test/material/tooltip_theme_test.dart @@ -1075,6 +1075,9 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ), @@ -1118,6 +1121,9 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ),