Skip to content
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

textField widget with rtl input problem #47745

Closed
idotalmor opened this issue Dec 24, 2019 · 76 comments
Closed

textField widget with rtl input problem #47745

idotalmor opened this issue Dec 24, 2019 · 76 comments
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: material design flutter/packages/flutter/material repository. found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-web Web applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@idotalmor
Copy link

idotalmor commented Dec 24, 2019

hello,
I am a flutter developer for quite some time, and I am building a flutter web page with textfield widgets for input some Hebrew text.
the problem is with the cursor.
we have 2 main issues:
when I am typing in Hebrew and press space the cursor is going to the start of the line
but the real issue is that I can't place the cursor in the right place where the user tapped.
it seems that the cursor is going to the location from the other side (mirror effect) I attached a video which present the issue which I am experiencing.

video:
https://imgur.com/VbYZq6B

@idotalmor idotalmor changed the title textField widget with rtf input problem textField widget with rtl input problem Dec 24, 2019
@iapicca
Copy link
Contributor

iapicca commented Dec 25, 2019

Hi @phoelapyae69
the link you provided doesn't appear to work;
can you please provide your flutter doctor -v ?
Thank you

possibly related to #39755

@iapicca iapicca added a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems labels Dec 25, 2019
@idotalmor
Copy link
Author

[✓] Flutter (Channel dev, v1.13.2, on Mac OS X 10.15.2 19C57, locale en-IL)
• Flutter version 1.13.2 at /Users/idotalmor/flutter
• Framework revision 4944622 (13 days ago), 2019-12-12 18:43:58 +0000
• Engine revision 12bf95f
• Dart version 2.7.0 (build 2.7.0-dev.2.1 8b8894648f)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/idotalmor/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = /Users/idotalmor/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B53
• CocoaPods version 1.8.4

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

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] IntelliJ IDEA Ultimate Edition (version 2018.1.5)
• IntelliJ at /Applications/IntelliJ IDEA.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
• Dart plugin version 181.4892.1
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.40.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
• Chrome • chrome • web-javascript • Google Chrome 79.0.3945.88
• Web Server • web-server • web-javascript • Flutter Tools

! Doctor found issues in 2 categories.

@idotalmor
Copy link
Author

btw - the link works fine for me please try again

@HansMuller HansMuller added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Jan 2, 2020
@HansMuller
Copy link
Contributor

shorturl.at/jrL26 - doesn't work for me either. Maybe just provide the complete link

@idotalmor
Copy link
Author

https://imgur.com/VbYZq6B
hope this work

@HansMuller
Copy link
Contributor

HansMuller commented Jan 2, 2020

Thanks, that video link works. I updated the issue's description.

@HansMuller HansMuller added the platform-web Web applications specifically label Jan 2, 2020
@HansMuller
Copy link
Contributor

CC @nturgut

@nturgut
Copy link
Contributor

nturgut commented Jan 3, 2020

Thanks for filing the issue and the video. I'll have a look.

@mikron123
Copy link

I had to create a special widget so the deletion in RTL text input will work after you reach a space ' '.
To reproduce - set your widget Directionality to RTL, write a sentence with spaces, then try to hit backspace all the way.
It get's stuck after deleting 1 word, probably also because the cursor is getting mislocated.

@Vofchuk
Copy link

Vofchuk commented May 12, 2020

I had to create a special widget so the deletion in RTL text input will work after you reach a space ' '.
To reproduce - set your widget Directionality to RTL, write a sentence with spaces, then try to hit backspace all the way.
It get's stuck after deleting 1 word, probably also because the cursor is getting mislocated.

Im having the exact same issue... any work around?

@mikron123
Copy link

mikron123 commented May 12, 2020

Enjoy my ugly code.... (that works. also with an 'enter' detection)

class SpecialInput extends StatefulWidget {

  String text;
  double width;
  String prompt;
  TextAlign textAlign;
  TextStyle textStyle;
  Function onChange;
  bool focusIfEmpty;
  TextEditingController controller;
  Function onEnter;
  FocusNode focusNode;
  TextInputType keyboardType;
  int maxLines;

  @override
  _specialInput createState() => _specialInput();
  SpecialInput({this.prompt = "",this.focusNode, this.keyboardType = TextInputType.text, this.maxLines = 1, this.onEnter = null,this.width,this.textAlign = TextAlign.center, this.textStyle,this.controller,this.text = "", this.onChange, this.focusIfEmpty = false}){
    if (focusNode == null)
      this.focusNode = new FocusNode();
  }
}
class _specialInput extends State<SpecialInput> {

  String _prevText;

  @override
  void initState() {

  }

  @override
  Widget build(BuildContext context) {
    if (widget.focusIfEmpty && widget.text == "" && widget.focusNode != null)
      widget.focusNode.requestFocus();

    widget.controller = new TextEditingController.fromValue(new TextEditingValue(text: widget.text,selection: new TextSelection.collapsed(offset: widget.text.length)));

    final inputFormatter = widget.keyboardType == TextInputType.number ? [WhitelistingTextInputFormatter.digitsOnly] : <TextInputFormatter>[];

    final txtInput = Container(child:
         TextFormField(controller: widget.controller,keyboardType: widget.keyboardType,
          style: widget.textStyle != null ? widget.textStyle : TextStyle(),maxLines: widget.maxLines,
          textDirection: AuxFuncs.isWeb ? TextDirection.rtl : TextDirection.ltr,textAlign: widget.textAlign,
          inputFormatters: inputFormatter,
          onChanged: (value){
            widget.text = value;
            //print(controller.selection.toString());
            // trying to delete but stuck
            if (_prevText == widget.text && widget.keyboardType != TextInputType.number)
              widget.text = widget.text.substring(0, widget.text.length - 2);
            _prevText = widget.text;
            widget.onChange(widget.text);
            setState(() {
            });
          },
          onFieldSubmitted: (str) {if (widget.onEnter != null) widget.onEnter(str);},
          autofocus: false,
          focusNode: widget.focusNode,
          decoration: InputDecoration(
            enabledBorder: UnderlineInputBorder(
              borderSide: BorderSide(color: widget.maxLines == 1 ? Colors.black45 : Colors.white.withOpacity(0)),
            ),
            focusedBorder: UnderlineInputBorder(
              borderSide: BorderSide(color: widget.maxLines == 1 ? Colors.black87 : Colors.white.withOpacity(0)),
               ),
            hintMaxLines: widget.maxLines,
            hintText: widget.prompt,
            hintStyle: TextStyle(color: Colors.black87.withOpacity(0.5),fontSize: 16),
            //prefixIcon: Icon(Icons.mail),
            contentPadding: EdgeInsets.all(5),
            border: UnderlineInputBorder(),
          ),
        ));
    return txtInput;
  }
}

@TahaTesser
Copy link
Member

Cursor issue

flutter doctor -v
[✓] Flutter (Channel dev, 1.19.0-1.0.pre, on Mac OS X 10.15.4 19E287, locale
    en-GB)
    • Flutter version 1.19.0-1.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision 456d80b9dd (2 days ago), 2020-05-11 11:45:03 -0400
    • Engine revision d96f962ca2
    • Dart version 2.9.0 (build 2.9.0-7.0.dev 092ed38a87)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/tahatesser/Code/SDK
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.9.1

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

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

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

[✓] Connected device (4 available)
    • Android SDK built for x86 • emulator-5554 • android-x86    • Android 10
      (API 29) (emulator)
    • macOS                     • macOS         • darwin-x64     • Mac OS X
      10.15.4 19E287
    • Web Server                • web-server    • web-javascript • Flutter Tools
    • Chrome                    • chrome        • web-javascript • Google Chrome
      81.0.4044.138

• No issues found!

@Vofchuk
Copy link

Vofchuk commented May 13, 2020

Im having the problem as shown:
https://gyazo.com/a6dd2dcbe85a80a117355284285d2a29
a6dd2dcbe85a80a117355284285d2a29

the cursor is not on the right spot, and I can't pick a certain letter or area of the text to add something on the middle:
https://gyazo.com/5229786c95909c76346d95c184ca3633
5229786c95909c76346d95c184ca3633

Also, i cant erase more than one word, after that the cursor just stop and don't erase...

the code is basically this:
(on the Text Field)
TextFormField( textDirection: isHebrew ? TextDirection.rtl : TextDirection.ltr,

(isHebrew is a boolean that holds if the text being typed is in Hebrew)

Any idea how to fix that? (i need a text input that can receive English and Hebrew text...)
hope that now is more clear!

@mikron123
Copy link

you can set the cursor position to the opposite position every time it changes. (listen with a controller)
so if the position is set on 1 and text length is 5, you will set it on 3 (since index starts from 0)

@kushalmahapatro
Copy link

kushalmahapatro commented May 20, 2020

Downgrading to v1.12.13+hotfix.9 makes everything fine. Tried with master, dev and stable 1.17.1. The RTL issue still exists in these environments.

@mikron123
Copy link

1.12.13+hotfix.9 is stable, how is it possible it even supports web? The problem is about the web platform.

@kushalmahapatro
Copy link

1.12.13+hotfix.9 is stable, how is it possible it even supports web? The problem is about the web platform.

I havn't tried for web, but the same kind of problem persist in Mobile Apps. In RTL, after adding a space the cursor doesn't moves and unable to delete the characters type before adding space.

@mohamadlounnas
Copy link

Any responses?

@nizar-khan
Copy link

No ، With every update I check the issue and unfortunately it still persists

@mohamadlounnas
Copy link

@nizar-khan @HansMuller @mdebbar @kf6gpe @ferhatb @mahmoudsalah37
Hi guys
this issue is may take a long time

There is an option to solved; it's not the best but better than nothing.
You need to use CanvasKit
flutter run --dart-define=FLUTTER_WEB_USE_SKIA=true
you need now to use custom font to render the Characters (Google fonts package may good idea)
I used for Arabic
TextField( style: GoogleFonts.cairo(), textDirection: TextDirection.rtl, )
and its work to me.
I don't know, but you may face some bugs but the text selection will work
i think this will work with other rtl languages
@kimeuysoo try font that supports your language
‪Application - Google Chrome‬ 2021-01-17 20-51-54

@mahmoudsalah37
Copy link

Nice man

@nizar-khan
Copy link

@mohamadlounnas Thank you bro, I'll try - but it looks like it will work, anyway thank you very much for this solution

@MarcinusX
Copy link
Contributor

MarcinusX commented Jan 18, 2021

What I've noticed is that in text.dart we are using getRectsForRange native method.

Float32List _getBoxesForRange(int start, int end, int boxHeightStyle, int boxWidthStyle) native 'Paragraph_getRectsForRange';

which later gets decoded in _decodeTextBoxes:

List<TextBox> _decodeTextBoxes(Float32List encoded) {
    final int count = encoded.length ~/ 5;
    final List<TextBox> boxes = <TextBox>[];
    int position = 0;
    for (int index = 0; index < count; index += 1) {
      boxes.add(TextBox.fromLTRBD(
        encoded[position++],
        encoded[position++],
        encoded[position++],
        encoded[position++],
        TextDirection.values[encoded[position++].toInt()],
      ));
    }
    return boxes;
  }

Observation:
When using RTL(Arabic) Locale but LTR(English) keyboard, on iOS it returns TextDirection.ltr which matches the keyboard but on Web it returns TextDirection.rtl.
By playing in the code and hardfixing ltr there, I was able to make web input with English keyboard and RTL locale work (it also broke the iOS implementation.
Still working on fixing RTL for Arabic keyboard.

Can anyone point me to where the native implementation of getRectsForRange for Web is placed? I believe that the actual proper fix is waiting right there.

@darshankawar
Copy link
Member

@idotalmor
I tried a sample code using latest master on web and was able to move the cursor as well as put spaces in it properly. Note that I used Google Translation to get text in Hebrew and pasted in TextFormField to verify the bug.

47745.mov
body: Center(
        child: TextFormField(
          textAlign: TextAlign.right,
          textDirection: TextDirection.rtl,
          decoration: InputDecoration(
            hintText: 'Enter here'
          ),
        )
      )

Can you confirm if this is working as expected now using latest version ?

flutter doctor -v
[✓] Flutter (Channel master, 1.26.0-18.0.pre.156, on Mac OS X 10.15.4 19E2269
    darwin-x64, locale en-IN)
    • Flutter version 1.26.0-18.0.pre.156 at
      /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision 45508985b1 (7 hours ago), 2021-02-02 22:46:04 -0500
    • Engine revision 2c144c3eeb
    • Dart version 2.12.0 (build 2.12.0-282.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.

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

[✓] Android Studio (version 4.1)
    • 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
      1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (3 available)
    • SM A260G (mobile) • 5200763ebcfa861f • android-arm    • Android 8.1.0 (API
      27)
    • macOS (desktop)   • macos            • darwin-x64     • Mac OS X 10.15.4
      19E2269 darwin-x64
    • Chrome (web)      • chrome           • web-javascript • Google Chrome
      88.0.4324.96

! Doctor found issues in 1 category.


@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 3, 2021
@idotalmor
Copy link
Author

moved to react on web implementation. much mature and production-ready.🤙

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 4, 2021
@darshankawar
Copy link
Member

Closing this as not reproducible per my earlier comment #47745 (comment) and based on issue author's above comment.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

[web] RTL support automation moved this from To do to Done Feb 9, 2021
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Feb 9, 2021
@MarcinusX
Copy link
Contributor

MarcinusX commented Mar 8, 2021

This is still not fully fixed.

It seems that the RTL on the web is fixed for RTL keyboards (like Arabic/Hebrew) but not for LTR ones (like English).

Here's the example on Flutter 2.0.1:
ezgif com-gif-maker (1)
Here's the gist: https://dartpad.dev/1e23cbb91c41d6e8f41df082295d3ccf?null_safety=true

Notice that the cursor is in a very weird place, ALMOST aligned to the right but not exactly (its 1, 2 chars before it).

Can we please reopen this issue? Logging in to our application using an English keyboard is the first thing users do, having the cursor in such a weird position will have a huge impact on the overall impression...

A similar thing happens when you use RTL keyboard in LTR locale (much less popular case though).

@TahaTesser TahaTesser reopened this Mar 9, 2021
[web] RTL support automation moved this from Done to In progress Mar 9, 2021
@TahaTesser
Copy link
Member

Thanks! @MarcinusX, I can confirm the issue

flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
    • Flutter version 2.0.1 at /Users/tahatesser/Code/flutter_stable
    • Framework revision c5a4b4029c (5 days ago), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (4 available)
    • SM M025F (mobile)    • R9ZR205XX0A               • android-arm    • Android 10 (API 29)
    • Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios            • iOS 14.4
    • macOS (desktop)      • macos                     • darwin-x64     • macOS 11.2.2 20D80 darwin-x64
    • Chrome (web)         • chrome                    • web-javascript • Google Chrome 89.0.4389.82

• No issues found!
[✓] Flutter (Channel master, 2.1.0-11.0.pre.165, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
    • Flutter version 2.1.0-11.0.pre.165 at /Users/tahatesser/Code/flutter_master
    • Framework revision 698d438960 (5 hours ago), 2021-03-09 07:53:21 +0100
    • Engine revision 2441c476a6
    • Dart version 2.13.0 (build 2.13.0-116.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (4 available)
    • SM M025F (mobile)    • R9ZR205XX0A               • android-arm    • Android 10 (API 29)
    • Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios            • iOS 14.4
    • macOS (desktop)      • macos                     • darwin-x64     • macOS 11.2.2 20D80 darwin-x64
    • Chrome (web)         • chrome                    • web-javascript • Google Chrome 89.0.4389.82

• No issues found!

@TahaTesser TahaTesser added found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 and removed found in release: 1.19 Found to occur in 1.19 labels Mar 9, 2021
@mikron123
Copy link

mikron123 commented Mar 16, 2021

Why is there a "hidden space" character in the string the TextField produces??
Consider the next string produced using the Flutter Web input text:
סתם ‏משהו

It looks like it contains 8 chars, but it actually contains 9. which made the string comparison a nightmare, that hidden character doesn't go away with ' ' replacement and as it is saved in the DB it's obviously problematic

Same happens with this one:
Hello ‎World
There is another invisible character after the space.

A character counter website to check the number of chars

@mdebbar
Copy link
Contributor

mdebbar commented Mar 16, 2021

@MarcinusX would you mind opening a new issue instead of re-opening this one? Your issue is slightly different from the one reported here (mention me on the new issue so I'm aware).

@mikron123 would you mind opening a separate issue for that with some code sample and more details? Like, is it happening on Android/iOS too? Please mention me on the new issue.

@ronytesler
Copy link

@mohamadlounnas
I tried your solution but I still see the caret is not in the correct position:
image

@hussamDana92
Copy link

i have the same issue

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: material design flutter/packages/flutter/material repository. found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-web Web applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
Development

No branches or pull requests