Content-Length: 356710 | pFad | https://github.com/flutter/flutter/issues/163607

31 Flutter Web: Screen jumps to a completely different location when tapping text in a Multiline TextField · Issue #163607 · flutter/flutter · GitHub
Skip to content

Flutter Web: Screen jumps to a completely different location when tapping text in a Multiline TextField #163607

@mycalls

Description

@mycalls

Steps to reproduce

On mobile Chrome or Safari, when tapping text in a TextField (with the maxLines property set to null and containing multiple lines of content), the screen jumps to the end of the text (on mobile Chrome) or to the middle of the text (on mobile Safari).

  1. Open the DartPad page on mobile Chrome or Safari. (Use of the soft keyboard is required)
  2. Run the code sample.
  3. Scroll to the end of the content.
  4. Tap the screen to activate the soft keyboard.
  5. Scroll up slightly, then tap the screen again.
  6. The screen moves to the end or middle of the content, not the place where you tapped.

Expected results

When tapping the TextField, the cursor should move to the tapped location.

Actual results

When tapping the TextField, the screen jumps to a completely different location.

Code sample

Code sample
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(home: const MyHomePage());
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

final _initialText = List.generate(
  500,
  (int index) => '${index + 1} abcdefg hijklmnop qrs tuv',
).join('\n');

class _MyHomePageState extends State<MyHomePage> {
  final _controller = TextEditingController(text: _initialText);

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('TextField Bug on Web')),
      body: TextField(controller: _controller, maxLines: null),
    );
  }
}

Screenshots or Video

Recording_2025-02-19-21-05-18.mp4
Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.2 24C101 darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.97.1)
[✓] Connected device (3 available)
[✓] Network resources

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.30Found to occur in 3.30fyi-text-inputFor the attention of Text Input teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/163607

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy