8000 [iOS Simulator] TextField adds spaces between characters when dragging cursor · Issue #167720 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 div id="responsive-meta-container" data-turbo-replace>

[iOS Simulator] TextField adds spaces between characters when dragging cursor #167720

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

Closed
RepliedSage11 opened this issue Apr 24, 2025 · 4 comments
Labels
r: solved Issue is closed as solved

Comments

@RepliedSage11
Copy link
Contributor
RepliedSage11 commented Apr 24, 2025

Steps to reproduce

  1. Create a TextField
  2. Drag the cursor across the text or use the arrow keys.

I can't reproduce this in a fresh flutter create project even though I am using the same code sample.
This is also only reproducible on iOS Simulator. This leads me to believe that this is not a framework issue but rather a Simulator or engine one and there are additional conditions to trigger this. I would appreciate any suggestions to try to track down the source of the issue so that I can provide a reproducible code sample.

I have used a fresh simulator (you can even see the first time tip when I open the keyboard).

Expected results

No spaces are added between characters.

Actual results

One space is added between the letters, but not symbols when changing the cursor position.

See the screen recording.

Code sample

I am unable to reproduce this on a fresh project, but this code reproduces the issue in my project.

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: InputPage());
  }
}

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

  @override
  State<InputPage> createState() => _InputPageState();
}

class _InputPageState extends State<InputPage> {
  final _baseUrlController = TextEditingController(
    text: 'no.spaces!between?symbols',
  );

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: TextField(
            decoration: const InputDecoration(labelText: 'text'),
            controller: _baseUrlController,
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2025-04-24.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.4 24E248 darwin-arm64, locale en-GB) [1,532ms]
    • Flutter version 3.29.3 on channel stable at /Users/alex/workspace/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ea121f8859 (13 days ago), 2025-04-11 19:10:07 +0000
    • Engine revision cf56914b32
    • Dart version 3.7.2
    • DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [2.3s]
    • Android SDK at /Users/alex/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME = /Users/alex/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 16.3) [1,272ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    ! CocoaPods 1.13.0 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [12ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2024.2) [12ms]
    • 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 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.99.3) [10ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.108.0

[✓] Connected device (3 available) [7.0s]
    • iPhone 15 Pro (mobile)          • 2348BBCF-963B-412E-9D7E-258EA7E42E24 • ios          • com.apple.CoreSimulator.SimRuntime.iOS-18-4 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64 • macOS 15.4 24E248 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin       • macOS 15.4 24E248 darwin-arm64
    ! Error: Browsing on the local area network for Alex’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [317ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.
@RepliedSage11 RepliedSage11 changed the title TextField adds spaces between characters when dragging cursor [iOS Simulator] TextField adds spaces between characters when dragging cursor Apr 24, 2025
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Apr 25, 2025
@danagbemava-nc
Copy link
Member

Hi @RepliedSage11, I can't seem to reproduce the issue with the sample provided above. See the recording below. Did you start experiencing this recently? If so, do you remember what changed about your environment?

Screen.Recording.2025-04-25.at.7.24.41.AM.mov

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 25, 2025
@RepliedSage11
Copy link
Contributor Author

I am not sure if this was a recent or a long standing bug, because it only reproduces on the simulator and I just haven't tried moving the cursor before that. This is all very strange, since it only reproduces when I use my project, even with the simple repro.
Do you have any ideas where to put prints/breakpoints to try to understand where this is coming from?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 25, 2025
@RepliedSage11
Copy link
Contributor Author

I reproduced this in a clean project by adding mobile_scanner as a dependency. I guess it is yet another x64 simulator bug similar to #155401 and #163380.

@danagbemava-nc
Copy link
Member

Given this seems to be another x64 simulator bug, I'll be closing this since there's not much we can do about this.

Thank you

@danagbemava-nc danagbemava-nc closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2025
@danagbemava-nc danagbemava-nc added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests

2 participants
0