Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Flutter 3.7 Magnifier on TextField gets stuck when used on a scrollable view on iOS #119711

Closed
@js2702

Description

@js2702

It seems that on iOS the magnifier of a TextField can get stuck in place after releasing the finger and it never disappears. This happens when you put it into a scrollable view. This only seems to happen when the TextField is empty.

Steps to reproduce:

Using an iOS device.

  1. flutter run
  2. Long press on the TextField with the text empty to trigger the magnifier
  3. Scroll up with that same finger over the magnifier

The magnifier seems to get stuck in the same place.

Expected results:
No magnifier

Actual results:

Stuck magnifier

import 'package:flutter/material.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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 without writing anything and drag upwards (like if you where to scroll at the same time) while doing it",
          ),
          const TextField(
            decoration: InputDecoration(hintText: "write something"),
          ),
          ...List.generate(
            20,
            (index) => ListTile(
              title: Text("Tile $index"),
            ),
          )
        ],
      ),
    );
  }
}
Logs
[✓] Flutter (Channel stable, 3.7.0, on macOS 13.1 22C65 darwin-x64, locale es-ES)
    • Flutter version 3.7.0 on channel stable at /Users/jorge/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (hace 9 días), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/jorge/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.74.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (5 available)
...
[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
RPReplay_Final1675265403.MP4

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions