Skip to content

[Android] Tapping Shift gets stuck into change-selection state #184744

Closed

Description

@gnprice

This is a fairly recent regression. The behavior it causes is extremely annoying when a user runs into it. After some user reports, I'd made a previous attempt to find a repro but not succeeded; thanks to @GrzegorzDyrda (#98720 (comment)) for pointing out Shift as the key ingredient.

Repro

  1. Open up a Flutter app on Android, with Gboard as the keyboard (e.g., a Pixel), and focus a text input.
  2. Type a couple of words.
  3. Tap earlier in the text input, then back at the end. The cursor will move where you tap.
  4. Now tap the Shift key.
  5. Again tap earlier in the text input, then back at the end.
  6. Expected: Again the cursor moves where you tap.
  7. Actual: A text selection opens up. One end of the selection moves where you tap; the other end remains where the cursor was. The text input remains in this state no matter how many times you tap, double-tap, etc., trying to get back to normal.

The impact is that it becomes impossible to continue editing normally in the text input. The user may have to abandon what they were typing, and navigate away from the screen and back in order to reset the whole text input from scratch.

Discussion

The symptom is similar to #98720, though the triggering situation is different. Discussion there might have clues to a diagnosis.

There's a workaround (from a user perspective) that might give a clue to a diagnosis: once you hit the space bar, things reset to normal. (Typing other text, on the other hand, keeps the text input in the broken state: when you tap somewhere after typing, only one selection handle moves while another stays behind where you'd typed. I'd hit on this workaround a few times before by accident, but only identified the space bar as the key after @GrzegorzDyrda made the connection to #98720.) Speculating, this might be related to the fact that hitting space normally resets the state of the Shift key (unshifted vs shift vs shift-lock).

We started seeing this behavior in a release of the Zulip app which we made last month using Flutter version a567e32 (from 2026-03-02). We hadn't seen it in previous Zulip releases, using Flutter versions up to 8cb340c (from 2026-01-08). Now that I have a repro, I've confirmed it's still present in the current version of Flutter main, 428e344.

Activity

  1. gnprice commented on Apr 8, 2026

    @gnprice
    MemberAuthor

    I should add the Gboard version I tested this on: 17.0.9.880768217-release-arm64-v8a. That's on a Pixel 8 running Android 16.

    And although the bug is clearly in Flutter, or at a minimum Flutter's problem to work around (because it doesn't seem to affect other apps), it's possible that the regression wasn't a change in Flutter: it could also have been a change in Gboard. In that case it'd be a Gboard update which just happened to roll out around the same time as the new Zulip release (with a new Flutter version) where the symptoms first appeared, about a month ago.

    One good way to confirm or disconfirm that would be to take a sample app on a device where the issue reproduces with current Flutter main, and try the repro on Flutter version 8cb340c (or older). If it doesn't reproduce, that verifies that the regression was within Flutter. If it does still reproduce, then the regression was some external change, most likely in Gboard.

  2. saurabh-mirajkar commented on Apr 8, 2026

    @saurabh-mirajkar
    Contributor

    @gnprice Thanks for the report. Labelling for team-text-input to investigate further.

  3. added
    a: text inputEntering text in a text field or keyboard related problems
    c: regressionIt was better in the past than it is now
    platform-androidAndroid applications specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIs
    fyi-androidFor the attention of Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Apr 8, 2026
  4. sandpaperback commented on Apr 8, 2026

    @sandpaperback

    I'm experiencing the same with both Gboard and Simple Keyboard on a Pixel 10.

    The "space" workaround didn't seem to work for me, but hitting backspace does. And actually, in testing just now it looks like sometimes just hitting the shift key works to let me place the cursor normally.

    Regarding the shift press I don't know if it's related, but the other frustrating thing I've noticed since this started happening (using the app Interstellar) is that the first character of a new sentence doesn't auto-capitalize. So I end a sentences with a ? or . and I expect that automatic Shift to happen, but it doesn't.

  5. GrzegorzDyrda commented on Apr 8, 2026

    @GrzegorzDyrda

    Since I experience this issue many times a day, I was forced to find some user-side workarounds myself:

    1. Shift double-tap usually exits this sticky selection-mode. But of course it leaves the selected text in a very weird capitalization.
    2. Also going to Gboard's Text editing and tapping the Select button brings things back to normal (see the attached screenshot).
    Image
  6. 10 remaining items

  7. added
    P1High-priority issues at the top of the work list
    triaged-androidTriaged by Android platform team
    on Apr 14, 2026
  8. added a commit that references this issue on Apr 29, 2026
    823b47d
  9. github-actions commented on May 13, 2026

    @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.

  10. locked as resolved and limited conversation to collaborators on May 13, 2026
  11. added a commit that references this issue on Jul 13, 2026
    cc545e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions