Repository navigation
[Android] Tapping Shift gets stuck into change-selection state #184744
Description
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
- Open up a Flutter app on Android, with Gboard as the keyboard (e.g., a Pixel), and focus a text input.
- Type a couple of words.
- Tap earlier in the text input, then back at the end. The cursor will move where you tap.
- Now tap the Shift key.
- Again tap earlier in the text input, then back at the end.
- Expected: Again the cursor moves where you tap.
- 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
gnprice commentedon Apr 8, 2026
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.
saurabh-mirajkar commentedon Apr 8, 2026
@gnprice Thanks for the report. Labelling for
team-text-inputto investigate further.sandpaperback commentedon Apr 8, 2026
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.
GrzegorzDyrda commentedon Apr 8, 2026
Since I experience this issue many times a day, I was forced to find some user-side workarounds myself:
Gboard'sText editingand tapping theSelectbutton brings things back to normal (see the attached screenshot).10 remaining items
[Android] Gboard Text Shift Stuck Fix (flutter#185292)
[CP-beta][Android] Gboard Text Shift Stuck Fix (#185749)
github-actions commentedon May 13, 2026
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 -vand a minimal reproduction of the issue.[Android] Gboard Text Shift Stuck Fix (flutter#185292)