Open ChunKaiC opened 1 year ago
Thanks for the report @ChunKaiC After running your code and inputing random text in the textfield, I see that first line gets 10 chars but other lines shows 9 chars as below:
Is that the behavior you are seeing and reporting ? Or you see another different result ?
Yes, my mistake, the screen shot you sent is the correct behaviour. The problem I'm currently experiencing is that sometimes when you spam right before a line break is about to be inserted this happens:
(This was done by pressing 'adsjkl' on the keyboard simultaneously)
No line break was inserted. Typing another character causes some characters to be deleted before being formatted:
(This was done by pressing 'd' after the previous screen shot)
This was found on the iOS simulator, however the problem seems to occur on iOS release mode as well.
Thanks for the update. Based on my findings earlier and above report, keeping this issue open for team's attention.
CC @LongCatIsLooong
What the code sample does
I am trying to build a text editor on top of the TextField. The code sample format's the text within a text field, adding a line break at every 10th character.
Steps to Reproduce
flutter run
on the code sampleExpected results: Text formatted correctly with a line break at every 10th character.
Actual results: Sometimes the formatting method within onChange does not apply correctly, meaning a line can exceed 10 characters before a line break. Occasionally some characters typed are deleted.
Code sample
```import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.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 TestEditor(), ); } } class TestEditor extends StatefulWidget { const TestEditor({super.key}); @override StateLogs
``` N/A ``` ``` Analyzing bug_example... No issues found! (ran in 1.1s) ``` ``` [✓] Flutter (Channel stable, 3.3.6, on macOS 13.0 22A380 darwin-arm, locale en-CA) • Flutter version 3.3.6 on channel stable at /Users/chunkaic/Developement/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6928314d50 (6 weeks ago), 2022-10-25 16:34:41 -0400 • Engine revision 3ad69d7be3 • Dart version 2.18.2 • DevTools version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at /Users/chunkaic/Library/Android/sdk • Platform android-32, build-tools 32.1.0-rc1 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14A400 • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • 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.12+0-b1504.28-7817840) [✓] VS Code (version 1.72.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.52.0 [✓] Connected device (3 available) • iPhone 14 Pro (mobile) • A0687B48-A2A3-4A34-991D-A88F4F0ABF47 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-0 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.0 22A380 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.94 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found! ```