diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index b0be65d286ef..6879f216e34a 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 09d9fd1d668c..df7801fb1e6d 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 ac7788206ec4..fe6d1eb99b9c 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 1cec48192cb5..db782afd8fd0 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 1f49edb3a026..e344dc64318f 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 619b4e7349ad..2fcc2e5de93a 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -699,6 +699,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 19f03af5d541..a3d1c60eeccc 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 f02a81556218..98d09e217fce 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -1450,6 +1450,9 @@ void main() { id: 1, tooltip: 'TIP', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ); @@ -1650,6 +1653,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 064a2f12bc09..4bfb3046bbea 100644 --- a/packages/flutter/test/material/tooltip_theme_test.dart +++ b/packages/flutter/test/material/tooltip_theme_test.dart @@ -1105,6 +1105,9 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ), @@ -1148,6 +1151,9 @@ void main() { tooltip: 'Foo', label: 'Bar', textDirection: TextDirection.ltr, + actions: [ + SemanticsAction.longPress, + ], ), ], ),