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

Korean input keyboard in android phone adding spaces between characters not creating proper text #145887

Open
muhammadarslannasr opened this issue Mar 28, 2024 · 5 comments
Labels
a: text input Entering text in a text field or keyboard related problems P3 Issues that are less important to the Flutter project platform-android Android applications specifically team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team

Comments

@muhammadarslannasr
Copy link

muhammadarslannasr commented Mar 28, 2024

Steps to reproduce

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: MyForm(),
  ));
}

class MyForm extends StatefulWidget {
  @override
  _MyFormState createState() => _MyFormState();
}

class _MyFormState extends State<MyForm> {
  final _formKey = GlobalKey<FormState>();
  final _textController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('TextFormField Example'),
      ),
      body: Form(
        key: _formKey,
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              TextFormField(
                controller: _textController,
                decoration: InputDecoration(
                  labelText: 'Enter your text',
                ),
                validator: (value) {
                  if (value == null || value.isEmpty) {
                    return 'Please enter some text';
                  }
                  return null;
                },
              ),
              SizedBox(height: 16.0),
              ElevatedButton(
                onPressed: () {
                  if (_formKey.currentState!.validate()) {
                    // Form is valid, proceed with your logic
                    String enteredText = _textController.text;
                    print('Entered text: $enteredText');
                  }
                },
                child: Text('Submit'),
              ),
            ],
          ),
        ),
      ),
    );
  }

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

Expected results

text should be concated and become a proper text instead spaces in words or letters

Actual results

text should be concated and become a proper text instead spaces in words or letters

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

https://drive.google.com/file/d/1JI-v1hAapbwqhOVtB1orCJuLqnTyv9tM/view?usp=drivesdk

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 28, 2024
@darshankawar
Copy link
Member

@muhammadarslannasr
Can you provide flutter doctor -v on which the reported behavior occurs ?
Also, provide the keyboard type you are using for Korean and check if this issue resembles your case or not.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 28, 2024
@muhammadarslannasr
Copy link
Author

my flutter doctor -v.

Flutter (Channel stable, 3.19.2, on macOS 14.4 23E214 darwin-arm64, locale en-PK)
• Flutter version 3.19.2 on channel stable at /Users/arslan/fvm/versions/3.19.2
! Warning: dart on your path resolves to /opt/homebrew/Cellar/dart/3.2.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/arslan/fvm/versions/3.19.2. Consider adding /Users/arslan/fvm/versions/3.19.2/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7482962 (4 weeks ago), 2024-02-27 16:51:22 -0500
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1

Link which you share i checked but issue not related to this.

also very strange same code working fine in iOS device but in android not working.

And another thing i am using Custom Theme does it effect? if effect then why not on iOS too.

@muhammadarslannasr Can you provide flutter doctor -v on which the reported behavior occurs ? Also, provide the keyboard type you are using for Korean and check if this issue resembles your case or not.

@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 Mar 28, 2024
@LongCatIsLooong
Copy link
Contributor

I can reproduce this on head, using Gboard

@LongCatIsLooong LongCatIsLooong added a: text input Entering text in a text field or keyboard related problems P2 Important issues not at the top of the work list team-text-input Owned by Text Input team platform-android Android applications specifically P1 High-priority issues at the top of the work list and removed P2 Important issues not at the top of the work list P1 High-priority issues at the top of the work list labels Mar 29, 2024
@LongCatIsLooong
Copy link
Contributor

LongCatIsLooong commented Mar 31, 2024

After updating Gboard (to 13.8.07.597073932) this is no longer reproducible. @muhammadarslannasr could you post the name and the version of the software keyboard you're using?

@LongCatIsLooong LongCatIsLooong added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 31, 2024
@muhammadarslannasr
Copy link
Author

muhammadarslannasr commented Mar 31, 2024

@LongCatIsLooong I have figure out the issue and you can also reproduce this with below code.

whenever use below onChange callback and pass onChange value to textEditingController spaces start coming on android but not on iOS, and if remove textEditingController = v; under onChange function works fine on both android and iOS.

onChange:(v){
_textController = v;  ///* this line create an issue if remove then works fine
}
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: MyForm(),
  ));
}

class MyForm extends StatefulWidget {
  @override
  _MyFormState createState() => _MyFormState();
}

class _MyFormState extends State<MyForm> {
  final _formKey = GlobalKey<FormState>();
  final _textController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('TextFormField Example'),
      ),
      body: Form(
        key: _formKey,
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              TextFormField(
                controller: _textController,
                decoration: InputDecoration(
                  labelText: 'Enter your text',
                ),
onChange:(v){
_textController = v;  ///* this line create an issue if remove then works fine
}
                validator: (value) {
                  if (value == null || value.isEmpty) {
                    return 'Please enter some text';
                  }
                  return null;
                },
              ),
              SizedBox(height: 16.0),
              ElevatedButton(
                onPressed: () {
                  if (_formKey.currentState!.validate()) {
                    // Form is valid, proceed with your logic
                    String enteredText = _textController.text;
                    print('Entered text: $enteredText');
                  }
                },
                child: Text('Submit'),
              ),
            ],
          ),
        ),
      ),
    );
  }

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

After updating Gboard (to 13.8.07.597073932) this is no longer reproducible. @muhammadarslannasr could you post the name and the version of the software keyboard you're using?

@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 Mar 31, 2024
@darshankawar darshankawar removed the in triage Presently being triaged by the triage team label Apr 1, 2024
@justinmc justinmc added P3 Issues that are less important to the Flutter project triaged-text-input Triaged by Text Input team and removed P2 Important issues not at the top of the work list labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems P3 Issues that are less important to the Flutter project platform-android Android applications specifically team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team
Projects
None yet
Development

No branches or pull requests

4 participants