Skip to content

TextField magnifier gets stuck on screen when long press is cancelled #167879

@O-Hannonen

Description

@O-Hannonen

Steps to reproduce

  1. Long press TextField to open magnifier
  2. While still long pressing, put the app to background with another finger (-> cancel long press)
  3. Open the app again

Expected results

Magnifier should close, similarly to when the long press ends (without cancelling)

Actual results

Magnifier is stuck on the screen, even if you scroll away from the textfield

Code sample

Example code
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Magnifier bug',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const MyHomePage(title: 'Magnifier bug'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: ListView(
        children: [
          const Text(
            "Long press to trigger the magnifier and while holding down, put the app into background. When coming back to app, the magnifier should be stuck on screen.",
          ),
           TextField(
            decoration: InputDecoration(hintText: "write something"),
          ),
          ...List.generate(
            20,
            (i) => GestureDetector(
                onTap: (){
              FocusScope.of(context).unfocus();
            },
              child: Container(
                height: 50,
                width: double.infinity,
                color: i % 2 == 0 ? Colors.red : Colors.blue,
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
ScreenRecording_04-26-2025.12-50-31_1.MP4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsfound in release: 3.29Found to occur in 3.29found in release: 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions