Skip to content

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

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.

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
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions