Skip to content

Samsung keyboard delay/lag when typing multiple lines #54310

Closed

Description

@GaryQian

Extracted from #51893 (comment)

@exptk3

[ Test divice : Galaxy s8 ]
[ Test sdk : Flutter Master Channel ]

*** Problems found in the last test

  1. Time delay of the keyboard up and down
  2. abnormal display of the keyboard even after the app is closed (on device home screen)
  3. word duplication input
  4. input line can not be changed during keyboard input
    *** I tested it on the same device (Galaxy s8) as in the last bug report.
    —> This time, during the test, the above problems were confirmed.
    —> Results of test
    3, 4 : resolved.
    1,2 : not resolved.

The duplicate input problem, which was a major problem, did not appear, but the time delay occurred when the keyboard was hidden or visible.
It seems that there is no delay time at the beginning of input, but if it is more than 3 ~ 4 lines of text input, the longer the sentence, the longer the delay time.
--> The delay time increases by more than 10 seconds, the performance is difficult to use in a real app.

I hope you reproduce the above bugs on your Galaxy s8 device.

================================================

*** Log when Keyboard up
…
W/IInputConnectionWrapper(27651): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(27651): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(27651): getExtractedText on inactive InputConnection
So many times
…

*** Log when Keyboard down

D/ViewRootImpl@b02d8a6MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@b02d8a6MainActivity: ViewPostIme pointer 1
D/InputMethodManager(27651): HSIFW - flag : 0 Pid : 27651

According to @TykanN, this was reproed on Galaxy Note 10, and not S9/S9+

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    perf: speedPerformance issues related to (mostly rendering) speed
    platform-androidAndroid applications specifically
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Apr 8, 2020
  2. njovy commented on Apr 9, 2020

    @njovy

    Please fix this asap. This bug happens in v1.15.17 as well. The previous keyboard bugs were severe but acceptable as users can modify content. However, this bug makes a flutter app using multiple lined text field completely unusable!!
    I can't release this due to this issue as the delay takes more than 4~5 seconds or longer.

  3. GaryQian commented on Apr 9, 2020

    @GaryQian
    ContributorAuthor

    @njovy I am currently trying to repro this, but am unable to do so on my test Note 9, Tab, and S9. Can you please let me know what device you are seeing this on, and the exact steps to reproduce this?

    Preferably, the exact TextField widget you used as well as detailed steps to encounter the delay. Thanks!

  4. added
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Apr 9, 2020
  5. njovy commented on Apr 10, 2020

    @njovy
    [✓] Flutter (Channel beta, v1.15.17, on Mac OS X 10.15.3 19D76, locale en-KR)
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    [✓] Android Studio (version 3.5)
    [✓] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
    [✓] Connected device (2 available)
    
    SM G965N                         • android-arm64 • Android 9 (API 28)
    
    import 'package:flutter/material.dart';
    import 'package:flutter/services.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return new MaterialApp(
          theme: new ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: new HomePage(),
        );
      }
    }
    
    class HomePage extends StatefulWidget {
      @override
      HomePageState createState() => HomePageState();
    }
    
    class HomePageState extends State<HomePage> {
      TextEditingController controller1 = TextEditingController();
      FocusNode focusNode1 = FocusNode();
    
      TextEditingController controller2 = TextEditingController(
          text:
          "속에 바로 거친 무엇을 고동을 구할 역사를 쓸쓸하랴? 그것은 설레는 이것은 주며, 있는 피고, 사막이다. 얼음과 많이 주며, 풀이 그들을 두기 튼튼하며, 모래뿐일 우리 뿐이다. 뛰노는 가치를 수 청춘의 청춘의 있다. 못할 하는 밥을 안고, 그들을 거친 길지 사막이다. 있으며, 설산에서 맺어, 밝은 이것은 그들은 철환하였는가? 따뜻한 보이는 때까지 인생에 청춘을 구하기 피부가 사막이다. 일월과 보이는 아니더면, 기관과 주는 있으랴? 것은 충분히 우는 아름다우냐? 청춘의 소리다.이것은 눈이 인생의 어디 전인 풍부하게 예가 교향악이다. 그러므로 청춘 트고, 그들의 못할 두손을 가장 아니더면, 뜨고, 뿐이다");
      FocusNode focusNode2 = FocusNode();
    
      @override
      void initState() {
        super.initState();
      }
    
      @override
      void dispose() {
        controller1.dispose();
        controller2.dispose();
        focusNode1.dispose();
        focusNode2.dispose();
        super.dispose();
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(title: Text("Keyboard Lag"),),
          body: SafeArea(
            child: Container(
              child: Column(
                children: <Widget>[
                  TextField(
                    controller: controller1,
                    focusNode: focusNode1,
                    maxLines: 7,
                    minLines: 7,
                    maxLength: 200,
                    keyboardType: TextInputType.text,
                    onSubmitted: (input) {
                      focusNode2.requestFocus();
                    },
                  ),
                  TextField(
                    controller: controller2,
                    focusNode: focusNode2,
                    maxLines: 10,
                    minLines: 10,
                    maxLength: 400,
                    keyboardType: TextInputType.text,
    
                  ),
                ],
              ),
            ),
          ),
        );
      }
    }

    @GaryQian Above is a minimal code that you can reproduce this bug.
    This bug only appears with a Samsung keyboard. I tested with my Galaxy S9+ running Android sdk 28.

    1. Run this code
    2. Tap a text field that already has a prefilled text.
    3. Make that keyboard disappear by pressing a device software button
    4. Re-tap the second text field.
    5. The bug appears with W/IInputConnectionWrapper( 378): getExtractedText on inactive InputConnection spamming.

    If you repeat those steps, it will make a device keyboard unusable and it affects a device even when the app is killed.

  6. GaryQian commented on Apr 10, 2020

    @GaryQian
    ContributorAuthor

    Oh this was run on the Beta channel, can you try on master? It was not clear what the bug was until the repro was explained! I believe I have already fixed this not too long ago, but the fixes have not yet rolled into the beta channel yet. I was unable to reproduce on master. Please let me know if that works for you!

    For reference, it may have been this revert that fixes it, though I only discovered that after I had landed it so it is not in the PR description. flutter-team-archive/engine#17391

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 10, 2020
  8. njovy commented on Apr 10, 2020

    @njovy

    @GaryQian I switched mine to master which is v1.18.0-5.0.pre.57 at the moment and the issue no longer appears. Thank you for a super rapid reply.

  9. GaryQian commented on Apr 10, 2020

    @GaryQian
    ContributorAuthor

    Awesome! I'll close the issue now! Please let me know if anyone is still seeing this on master channel and I can reopen.

  10. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 10, 2020
  11. dannyvalentesonos commented on Apr 10, 2020

    @dannyvalentesonos
    Contributor

    @GaryQian This is great news! Is it easy for you to tell me if this and #51893 are fixed in 1.18.0-dev.3.0 or if it really only is in master at the moment?

    Thanks!

  12. exptk3 commented on Apr 10, 2020

    @exptk3

    Awesome! I'll close the issue now! Please let me know if anyone is still seeing this on master channel and I can reopen.

    Hi. Thanks for your effort.
    I tested again on master channel. (device : Galaxy s8)

    • Test info
      flutter --version
      Flutter 1.15.4-pre.241 • channel master • https://github.com/flutter/flutter.git
      Framework • revision 1d3fcfd (6 weeks ago) • 2020-02-29 10:01:18 -0800
      Engine • revision 755e2b5
      Tools • Dart 2.8.0 (build 2.8.0-dev.10.0 09bbd3cca5)

    < Keybord show-hide delay >

    • The issue of time delays when keyboards up and down is better than before, but I still see them happening. (The larger the amount of writing, the easier it is to reproduce.)
      You can check this by creating two text fields, and writing more than 30 lines alternately.
      There is still a delay of 3 to 15 seconds or more...
    • In severe cases, the keyboard hiding and appearing functions were disabled. (After turning the screen off (power-saving) and turning it on ..)
      --> Correction: It was not usable, but waited for more than 1 minute, eventually it worked.

    < input word duplication >

    • After a lot of tests for the duplicate input bug, it was much better than before, but in some cases, the duplicate input bug was repeatedly reproduced.
       - Reproducing : The same word was entered repeatedly when the input was started again after stopping the keyboard input in the middle of the sentence input to make focusing disappear.
    • Then, a new problem was showed. In the above case, after focusing disappeared, pressing the backspace (delete) button on the device's soft keyboard caused the entire line to be deleted.

    *** In summary, there is still a keyboard up and down delay bug, a word duplicate input bug, and a new entire sentence deletion bug added .

    Be sure to reproduce it on the Galaxy s8 device.
    If you test it on a Galaxy s8 device, you're sure to be able to reproduce it easily.

    Thank you.

  13. njovy commented on Apr 10, 2020

    @njovy

    @exptk3 1.15.4-pre.241 is an outdated version. flutter upgrade to apply GaryQian's fix. Make sure clean and re-build after upgrade just in case.

  14. njovy commented on Apr 10, 2020

    @njovy

    @dannyvalentesonos You can search commit history when flutter-team-archive/engine#17391 has been rolled out to flutter sdk. I've confirmed that the latest beta channel has this fix applied so I am testing my apps on this channel at the moment.

  15. exptk3 commented on Apr 10, 2020

    @exptk3

    @exptk3 1.15.4-pre.241 is an outdated version. flutter upgrade to apply GaryQian's fix. Make sure clean and re-build after upgrade just in case.

    Ok. Maybe I missed it.
    I will upgrade my flutter and try again tomorrow.
    Thank you.

  16. dannyvalentesonos commented on Apr 10, 2020

    @dannyvalentesonos
    Contributor

    @dannyvalentesonos You can search commit history when flutter/engine#17391 has been rolled out to flutter sdk. I've confirmed that the latest beta channel has this fix applied so I am testing my apps on this channel at the moment.

    Thanks @njovy
    I'm still unclear how to see if the Beta or Dev channel has the fix, and if so, which version of the beta/dev channel got it. I don't see how to link the engine roll commits to this information. Can you provide some clarity here? Thanks

  17. njovy commented on Apr 10, 2020

    @njovy

    https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
    @dannyvalentesonos Above is a link where you can check a git commit reference by channels.
    I usually check the date of merged and most time it's applied but if you want to make sure, check whether it's reverted.
    If you want to check beta for instance, I would go to https://github.com/flutter/flutter/commits/beta and which version of flutter engine has been applied or reverted to sdk, plus search pull requests by the issue number. https://github.com/flutter/flutter/commits/beta?after=d3ed9ec945f8869f0e136c357d0c2a6be2b60c98+34 verifies that the current latest beta has a samsung keyboard fix applied.

  18. dannyvalentesonos commented on Apr 10, 2020

    @dannyvalentesonos
    Contributor

    Thanks @njovy

  19. njovy commented on Apr 11, 2020

    @njovy

    @dannyvalentesonos Needs one more correction the latest beta doesn't have flutter-team-archive/engine#17426 applied so use 1.17.0-dev.4.0 or later! Sorry for the confusion.

  20. dannyvalentesonos commented on Apr 11, 2020

    @dannyvalentesonos
    Contributor

    Thanks @njovy. I'm using the latest Dev channel build at the moment.

  21. exptk3 commented on Apr 11, 2020

    @exptk3

    I updated flutter sdk version and tested again.

    < flutter sdk info >
    Flutter 1.18.0-5.0.pre.84 • channel master • https://github.com/flutter/flutter.git
    Framework • revision 8ecd5e8 (7 hours ago) • 2020-04-10 19:55:02 -0400
    Engine • revision 68fd833

    • device : galaxy s8

    • result : All bugs are gone and the app works fine.

    Thanks @njovy @GaryQian

  22. lock commented on Apr 25, 2020

    @lock

    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.

  23. locked and limited conversation to collaborators on Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.dependency: androidAndroid team may need to help use: device-specificOnly manifests on certain devicesperf: speedPerformance issues related to (mostly rendering) speedplatform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions