Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit d278808

Browse files
esouthrenliumcseTahaTesserharperl-lgtm
authored
[Re-land] Exposed tooltip longPress (#118796)
* Check whether slider is mounted before interaction, no-op if unmounted (#113556) * Check whether slider is unmounted before interaction * Update slider.dart * Update Slider * Add test * Update slider_test.dart * Update packages/flutter/test/material/slider_test.dart Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Taha Tesser <[email protected]> * exposed tooltip longPress action when available * updated tooltip test * updated date picker test --------- Co-authored-by: Mingyu <[email protected]> Co-authored-by: Taha Tesser <[email protected]> Co-authored-by: Harper Liu <[email protected]>
1 parent 3af30ff commit d278808

9 files changed

+28
-3
lines changed

packages/flutter/lib/src/material/tooltip.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ class TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
751751
behavior: HitTestBehavior.opaque,
752752
onLongPress: (_triggerMode == TooltipTriggerMode.longPress) ? _handlePress : null,
753753
onTap: (_triggerMode == TooltipTriggerMode.tap) ? _handleTap : null,
754-
excludeFromSemantics: true,
754+
excludeFromSemantics: _excludeFromSemantics,
755755
child: result,
756756
);
757757
// Only check for hovering if there is a mouse connected.

packages/flutter/test/material/back_button_test.dart

+2
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ void main() {
172172
hasEnabledState: true,
173173
isEnabled: true,
174174
hasTapAction: true,
175+
hasLongPressAction: true,
175176
isFocusable: true,
176177
));
177178
handle.dispose();
@@ -216,6 +217,7 @@ void main() {
216217
hasEnabledState: true,
217218
isEnabled: true,
218219
hasTapAction: true,
220+
hasLongPressAction: true,
219221
isFocusable: true,
220222
));
221223
handle.dispose();

packages/flutter/test/material/calendar_date_picker_test.dart

+2
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ void main() {
672672
tooltip: 'Previous month',
673673
isButton: true,
674674
hasTapAction: true,
675+
hasLongPressAction: true,
675676
isEnabled: true,
676677
hasEnabledState: true,
677678
isFocusable: true,
@@ -680,6 +681,7 @@ void main() {
680681
tooltip: 'Next month',
681682
isButton: true,
682683
hasTapAction: true,
684+
hasLongPressAction: true,
683685
isEnabled: true,
684686
hasEnabledState: true,
685687
isFocusable: true,

packages/flutter/test/material/chip_test.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,10 @@ void main() {
20472047
children: <TestSemantics>[
20482048
TestSemantics(
20492049
tooltip: 'Delete',
2050-
actions: <SemanticsAction>[SemanticsAction.tap],
2050+
actions: <SemanticsAction>[
2051+
SemanticsAction.tap,
2052+
SemanticsAction.longPress
2053+
],
20512054
textDirection: TextDirection.ltr,
20522055
flags: <SemanticsFlag>[
20532056
SemanticsFlag.isButton,

packages/flutter/test/material/date_picker_test.dart

+2
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ void main() {
833833
tooltip: 'Switch to input',
834834
isButton: true,
835835
hasTapAction: true,
836+
hasLongPressAction: true,
836837
isEnabled: true,
837838
hasEnabledState: true,
838839
isFocusable: true,
@@ -876,6 +877,7 @@ void main() {
876877
tooltip: 'Switch to calendar',
877878
isButton: true,
878879
hasTapAction: true,
880+
hasLongPressAction: true,
879881
isEnabled: true,
880882
hasEnabledState: true,
881883
isFocusable: true,

packages/flutter/test/material/floating_action_button_test.dart

+1
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ void main() {
700700
tooltip: 'Add Photo',
701701
actions: <SemanticsAction>[
702702
SemanticsAction.tap,
703+
SemanticsAction.longPress,
703704
],
704705
flags: <SemanticsFlag>[
705706
SemanticsFlag.hasEnabledState,

packages/flutter/test/material/search_test.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,10 @@ void main() {
620620
SemanticsFlag.isEnabled,
621621
SemanticsFlag.isFocusable,
622622
],
623-
actions: <SemanticsAction>[SemanticsAction.tap],
623+
actions: <SemanticsAction>[
624+
SemanticsAction.tap,
625+
SemanticsAction.longPress,
626+
],
624627
tooltip: 'Back',
625628
textDirection: TextDirection.ltr,
626629
),

packages/flutter/test/material/tooltip_test.dart

+6
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,9 @@ void main() {
14181418
id: 1,
14191419
tooltip: 'TIP',
14201420
textDirection: TextDirection.ltr,
1421+
actions: <SemanticsAction>[
1422+
SemanticsAction.longPress,
1423+
],
14211424
),
14221425
],
14231426
);
@@ -1618,6 +1621,9 @@ void main() {
16181621
tooltip: 'Foo',
16191622
label: 'Bar',
16201623
textDirection: TextDirection.ltr,
1624+
actions: <SemanticsAction>[
1625+
SemanticsAction.longPress,
1626+
],
16211627
),
16221628
],
16231629
),

packages/flutter/test/material/tooltip_theme_test.dart

+6
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,9 @@ void main() {
10751075
tooltip: 'Foo',
10761076
label: 'Bar',
10771077
textDirection: TextDirection.ltr,
1078+
actions: <SemanticsAction>[
1079+
SemanticsAction.longPress,
1080+
],
10781081
),
10791082
],
10801083
),
@@ -1118,6 +1121,9 @@ void main() {
11181121
tooltip: 'Foo',
11191122
label: 'Bar',
11201123
textDirection: TextDirection.ltr,
1124+
actions: <SemanticsAction>[
1125+
SemanticsAction.longPress,
1126+
],
11211127
),
11221128
],
11231129
),

0 commit comments

Comments
 (0)