Skip to content

Ordering of IMM calls #41990

Closed
Closed

Description

@mklim

We've recently been informed that the order in which we trigger IMM callbacks is different from standard Android text fields.

Specifically, somehow we're triggering InputMethodManager#onShowInputRequested() after IMM#onUpdateSelection(), when normally the flow is onShowInputRequested -> onUpdateSelection.

We should debug and confirm this ourselves. It's not immediately obvious to me how we're triggering either of those callbacks, but there's likely call sites in TextInputPlugin.java (IMM#updateSelection, IMM#showSoftInput).

/cc @GaryQian @jason-simmons

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    on Oct 4, 2019
  2. GaryQian commented on Oct 8, 2019

    @GaryQian
    Contributor

    This does seem very likely to be root cause of all the samsung bugs we are seeing. It looks like the field is being updated before the keyboard is shown, which prevents the update reaching the keyboard, thus causing the keyboard to treat the field as empty and inserting the duplicate text.

  3. GaryQian commented on Oct 16, 2019

    @GaryQian
    Contributor

    b/141639086 for reference

  4. GaryQian commented on Oct 30, 2019

    @GaryQian
    Contributor

    I have attempted to call the show keyboard method before the update editing state, but it does not seem to have an effect on any of the Samsung keyboard bugs.

  5. GaryQian commented on Oct 30, 2019

    @GaryQian
    Contributor

    Specifically, I have tried ensuring editable_text.dart _openInputConnection() calls _textInputConnection.show() before _textInputConnection.setEditingState() but it has no impact.

  6. GaryQian commented on Nov 6, 2019

    @GaryQian
    Contributor

    #43865 should reorder the calls. The bugs that this attempts to fix are still present, but this specific one should be resolved. We should look for alternative leads to fixing the relevant bugs.

    I'm going to close this issue, but the remaining related issues are tracked in #42273 and b/141639086

  7. github-actions commented on Aug 26, 2021

    @github-actions

    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.

  8. locked as resolved and limited conversation to collaborators on Aug 26, 2021
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 problemsengineflutter/engine related. See also e: labels.platform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions