mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[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 <tessertaha@gmail.com> Co-authored-by: Taha Tesser <tessertaha@gmail.com> * exposed tooltip longPress action when available * updated tooltip test * updated date picker test --------- Co-authored-by: Mingyu <lyming90@gmail.com> Co-authored-by: Taha Tesser <tessertaha@gmail.com> Co-authored-by: Harper Liu <harperl0818@gmail.com>
This commit is contained in:
parent
3af30ff591
commit
d278808014
@ -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,
|
||||
|
@ -700,6 +700,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,
|
||||
),
|
||||
|
@ -1418,6 +1418,9 @@ void main() {
|
||||
id: 1,
|
||||
tooltip: 'TIP',
|
||||
textDirection: TextDirection.ltr,
|
||||
actions: <SemanticsAction>[
|
||||
SemanticsAction.longPress,
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
@ -1618,6 +1621,9 @@ void main() {
|
||||
tooltip: 'Foo',
|
||||
label: 'Bar',
|
||||
textDirection: TextDirection.ltr,
|
||||
actions: <SemanticsAction>[
|
||||
SemanticsAction.longPress,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1075,6 +1075,9 @@ void main() {
|
||||
tooltip: 'Foo',
|
||||
label: 'Bar',
|
||||
textDirection: TextDirection.ltr,
|
||||
actions: <SemanticsAction>[
|
||||
SemanticsAction.longPress,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -1118,6 +1121,9 @@ void main() {
|
||||
tooltip: 'Foo',
|
||||
label: 'Bar',
|
||||
textDirection: TextDirection.ltr,
|
||||
actions: <SemanticsAction>[
|
||||
SemanticsAction.longPress,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user