Unverified Commit 38e3930f authored by harperl-lgtm's avatar harperl-lgtm Committed by GitHub

Exposed tooltip longPress action when available (#117338)

* Exposed tooltip longPress action when available (Trigger mode is long press)
parent 7f7a8778
......@@ -751,7 +751,7 @@ class TooltipState extends State<Tooltip> 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.
......
......@@ -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();
......
......@@ -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,
......
......@@ -2047,7 +2047,10 @@ void main() {
children: <TestSemantics>[
TestSemantics(
tooltip: 'Delete',
actions: <SemanticsAction>[SemanticsAction.tap],
actions: <SemanticsAction>[
SemanticsAction.tap,
SemanticsAction.longPress
],
textDirection: TextDirection.ltr,
flags: <SemanticsFlag>[
SemanticsFlag.isButton,
......
......@@ -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,
......
......@@ -699,6 +699,7 @@ void main() {
tooltip: 'Add Photo',
actions: <SemanticsAction>[
SemanticsAction.tap,
SemanticsAction.longPress,
],
flags: <SemanticsFlag>[
SemanticsFlag.hasEnabledState,
......
......@@ -620,7 +620,10 @@ void main() {
SemanticsFlag.isEnabled,
SemanticsFlag.isFocusable,
],
actions: <SemanticsAction>[SemanticsAction.tap],
actions: <SemanticsAction>[
SemanticsAction.tap,
SemanticsAction.longPress,
],
tooltip: 'Back',
textDirection: TextDirection.ltr,
),
......
......@@ -1450,6 +1450,9 @@ void main() {
id: 1,
tooltip: 'TIP',
textDirection: TextDirection.ltr,
actions: <SemanticsAction>[
SemanticsAction.longPress,
],
),
],
);
......@@ -1650,6 +1653,9 @@ void main() {
tooltip: 'Foo',
label: 'Bar',
textDirection: TextDirection.ltr,
actions: <SemanticsAction>[
SemanticsAction.longPress,
],
),
],
),
......
......@@ -1105,6 +1105,9 @@ void main() {
tooltip: 'Foo',
label: 'Bar',
textDirection: TextDirection.ltr,
actions: <SemanticsAction>[
SemanticsAction.longPress,
],
),
],
),
......@@ -1148,6 +1151,9 @@ void main() {
tooltip: 'Foo',
label: 'Bar',
textDirection: TextDirection.ltr,
actions: <SemanticsAction>[
SemanticsAction.longPress,
],
),
],
),
......
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