Skip to content

Application crash when dragging mouse over Tooltip while selecting text in SelectionArea #129969

@damphat

Description

@damphat

Is there an existing issue for this?

Steps to reproduce

  1. Write an app with SelectionArea, add some text and some widget that show tooltips
  2. Keep drag the mouse cursor to select the text, try to move the mouse over a tooltip
  3. Crash in desktop debug mode (macOS in my case)

Expected results

Should be able to select the text

Actual results

Exception has occurred.
_AssertionError ('package:flutter/src/rendering/object.dart': Failed assertion: line 3263 pos 14: 'renderer.parent != null': is not true.)

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: CrashTest(),
    );
  }
}

class CrashTest extends StatelessWidget {
  const CrashTest({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SelectionArea(
        child: Center(
          child: Column(
            children: [
              const Text("Select me"),
              const Text("Select me"),
              Tooltip(
                showDuration: const Duration(seconds: 30),
                message: 'Drag your mouse over me to crash your app',
                child: Container(
                  width: 50,
                  height: 50,
                  color: Colors.red,
                ),
              ),
              const Text("Select me"),
              const Text("Select me"),
              const Text("Select me"),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]
crash

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.12.0-12.0.pre.40, on macOS 13.2.1 22D68 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
[✓] VS Code (version 1.79.2)
[✓] VS Code (version 1.80.0-insider)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.12Found to occur in 3.12frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions