Skip to content

Wrapping GestureDetector in a Tooltip widget causes onTapCancel  #84531

@krll-kov

Description

@krll-kov

GestureDetector taps(wrapped with a Tooltip widget) longer than 0.6 seconds cause onTapCancel executing instead of onTapUp.

minimal code sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar'),
        ),
        body: Tooltip(message: 'test', child: DemoIconButton()),
      ),
    );
  }
}

class DemoIconButton extends StatefulWidget {
  @override
  _DemoIconButtonState createState() => _DemoIconButtonState();
}

class _DemoIconButtonState extends State<DemoIconButton> {
  @override
  Widget build(BuildContext context) {
    return MouseRegion(
      child: GestureDetector(
        onTapDown: (_) => print('onTapDown'),
        onTapUp: (_) => print('onTapUp'),
        onTapCancel: () => print('onTapCancel'),
        child: Icon(
          Icons.phone_locked,
          color: Colors.purple,
        ),
      ),
    );
  }
}

Flutter version: 2.2.2 from the stable channel

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: solvedIssue is closed as solved

Type

No type

Projects

Status

Issue closed with comment

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions