text selection from keyboard arrows does not work

(#3518) Bug Open: Confirmed Priority: P2 mobile

Reproduction steps

  1. use a keyboard with text selection, such as Google Gboard
  2. open chat anywhere in Fluxer Beta mobile app and type something
  3. enter selection mode
  4. press the arrows

Observed behaviour

my cursor moves as expected, but doesn't select along the way, and even discards any active selection. (when pressing the equivalents of Home/End, it selects all the way to the start or end of the message, though. only arrows behave incorrectly)

Build information

Version 2026.10.100, Beta 2, Channel Beta, Build 2590, Android 17 (arm64), Device Google Pixel 9a, Locale en-US, Push unifiedpush, Flutter 3.47.6, Dart 3.13.5

Platform

Android

Evidence

Details

Expected behaviour the text should be selected under my cursor, so long as i am in select mode

6 comments

Sign in with Fluxer to comment and vote.
Comment by mesub
mesubMod 1 vote
Status changed from Needs triage to Confirmed
CR: Version 2026.10.100, Channel Canary, Build 2604, Android 15 (arm64), Device OnePlus CPH2465, Locale en-GB, Push unifiedpush, Flutter 3.47.6, Dart 3.13.5 | NB: Using GBoard.
Comment by Dinosaur Gnatalie
Can reproduce CR - Possibly specific to Gboard? I was not able to repro the issue using FUTO and several other keyboards I tried, only Gboard. Version 2026.10.100, Beta 2, Channel Beta, Build 2591, Android 16 (arm64), Device Google Pixel 9 Pro, Locale en-US, Push fcm, Flutter 3.47.6, Dart 3.13.5
Comment by Jinx
CR:
Version 2026.11.300, Beta 1, Channel Beta, Build 3040, Android 17 (arm64), Device samsung SM-A346B, Locale en-DE, Push fcm, Flutter 3.47.9, Dart 3.13.7
GBoard Version, latest: 18.6.3
Comment by Charles W (K5CDW)
Can reproduce on the current Beta, and it isn't specific to Gboard or to the composer. What I tested (Pixel 6 Pro, Android 17, Gboard 18.5.6.993608717):
  1. Gboard selection mode: text editing panel → Select → ← moves the cursor but selects nothing. |← and Select all do select. Reproduced several times.
  2. Shift+Left key event over adb (adb shell input keycombination SHIFT_LEFT DPAD_LEFT, ×4): the cursor moves 4 characters and nothing is selected. Typing a character afterwards inserts it at the cursor (hello world Xtest) instead of replacing a selection.
  3. Not specific to the composer: the same thing happens in the channel search field.
  4. Control: in a native text field (the Microsoft Edge address bar), both the adb Shift+Left and Gboard's selection-mode ← select one character per press.
Root cause: a Flutter regression, flutter/flutter#185849 (P1, open, no fix PR yet), introduced by flutter/flutter#185292 ("[Android] Gboard Text Shift Stuck Fix"). Since that change, the Android embedder (KeyEmbedderResponder.synchronizePressingKey) no longer synthesizes a Shift press from metaState for VIRTUAL_KEYBOARD events. Gboard's selection-mode arrows only carry META_SHIFT_ON, so the framework handles them as plain arrows and just moves the cursor. Fluxer builds on Flutter 3.47.x are affected. That probably explains why other keyboards (FUTO etc.) don't show it: they set the selection directly instead of sending Shift+arrow. The same regression is behind Ctrl shortcuts from FUTO breaking on 3.47 (reported in the Flutter issue). Possible app-side workaround until Flutter fixes it: ImeEditingShortcutBridge.kt already works around the Ctrl half of this regression for virtual keyboards. Extending imeEditingShortcutFor() so Shift+DPAD_LEFT/RIGHT/UP/DOWN (no other modifiers) map to new kinds sent over the same fluxer_app/ime_editing_shortcut channel, and mapping those in textEditingIntentFor() to ExtendSelectionByCharacterIntent / ExtendSelectionVerticallyToAdjacentLineIntent with collapseSelection: false, should restore selection in every text field. FluxerClipboardScope.handleTextEditingShortcut just needs to return ignored for the new kinds so they fall through to the default actions.
Version 2026.11.300, Beta 1, Channel Beta, Build 3040
Android 17 (arm64)
Device Google Pixel 6 Pro
Locale en-US
Gboard 18.5.6.993608717
Comment by Charles W (K5CDW)

Follow-up to my comment above: a workaround tested on a device

Short version: the real fix belongs in Flutter, not Fluxer (flutter/flutter#185849, a regression in Flutter's Android key handling since 3.47). Fluxer can't fix the root cause in the app itself. The bug clears up once Flutter ships a fix and Fluxer moves to that release. Until then, the stopgap below restores Gboard selection in Fluxer, if you want to ship something in the meantime. Correction to my earlier suggestion In my last comment I suggested extending ImeEditingShortcutBridge.kt. I built and tested that on a device, and it doesn't work. With the keyboard open, Gboard's arrows reach Flutter through the IME's input connection (InputConnectionAdaptor.sendKeyEvent → KeyboardManager) and never go through Activity.dispatchKeyEvent, where the bridge sits. Stopgap that works
  • Wrap ServicesBinding.instance.keyEventManager.keyMessageHandler. Flutter drops Shift before building the KeyEvent, but the raw Android event (RawKeyEventDataAndroid) still has it in metaState, with deviceId == -1.
  • For Shift+DPAD ←→↑↓ from the virtual keyboard, with no Ctrl/Alt/Meta, run ExtendSelectionByCharacterIntent / ExtendSelectionVerticallyToAdjacentLineIntent (collapseSelection: false) on the focused field and mark the event handled. This reuses the existing TextEditingShortcutKind / performTextEditingShortcut plumbing.
  • Steps aside by itself: it only acts while HardwareKeyboard.instance.isShiftPressed is false. Once Flutter fixes #185849 and the framework sees Shift again, events fall through to Flutter's default text editing shortcuts, so the workaround can simply be deleted later. Physical keyboards are never affected.
  • Caveat: it relies on the deprecated raw key API. That's the only place the Shift flag is still visible on the Dart side, which is another reason it should be temporary.
Testing (same device and keyboard as above; self-built from canary 022f1249, build 3021, Flutter 3.47.9)
  • Unit + widget tests: the mapping, extending a real TextField from a raw Shift+Left message, and stepping aside when Shift is already pressed. They pass alongside the existing text-input tests, and the analyzer and formatter are clean.
  • On the phone:
    • Gboard selection-mode ← / → select and shrink the selection one character at a time, in the composer and in channel search.
    • adb Shift+Left ×4 selects test.
    • Plain arrows, |←, Select all, and Gboard's change-case (⇧ on a selection) behave as before.
The patch is about 280 lines, mostly tests: one new file (virtual_keyboard_shift_arrows.dart) plus small changes to text_editing_shortcuts.dart, fluxer_clipboard_scope.dart and main.dart. Happy to share it or open a PR. Either way, a 👍 or a "Fluxer is affected" comment on the Flutter issue would help get the real fix prioritized.
Comment by Charles W (K5CDW)
The stopgap described above is now on a branch in my fork, ready for review: https://github.com/sdjrdriver/flutter_client/tree/fix/gboard-shift-arrow-selection I'll open the PR once I have Fluxer Labs access. Just a reminder that this is only a stopgap: the real fix is in Flutter (flutter/flutter#185849), and the workaround steps aside by itself once Flutter ships it.