Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Tooltip widget replaces child when cursor enter/leaves window #1125

Open
Lootwig opened this issue Oct 15, 2024 · 0 comments
Open

🐛 Tooltip widget replaces child when cursor enter/leaves window #1125

Lootwig opened this issue Oct 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Lootwig
Copy link

Lootwig commented Oct 15, 2024

This seems to have been an issue in flutter material too, fixed here:

When the mouse leaves/enters the window, the child of Tooltip is created with an entirely new state. Repro:

import 'package:fluent_ui/fluent_ui.dart';

void main() {
  runApp(FluentApp(
    home: ColoredBox(
      color: Colors.white,
      child: Center(
        child: Tooltip(
          message: 'if this string is empty, issue does not occur',
          child: StatefulText(),
        ),
      ),
    ),
  ));
}

class StatefulText extends StatefulWidget {
  const StatefulText({super.key});

  @override
  State<StatefulText> createState() => _StatefulTextState();
}

class _StatefulTextState extends State<StatefulText> {
  static int count = 1;

  @override
  void initState() {
    super.initState();
    count++;
  }

  @override
  Widget build(BuildContext context) {
    return Text(
      'this initState ran $count times (on window cursor enter/exit)',
    );
  }
}
@bdlukaa bdlukaa added the bug Something isn't working label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants