Skip to content

fix: harden IME selection handling for WebView - #10

Merged
zefutoff merged 2 commits into
mainfrom
fix/ime-selection-jank
Oct 6, 2026
Merged

zefutoff merged 2 commits into
mainfrom
fix/ime-selection-jank

Conversation

@zefutoff

@zefutoff zefutoff commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Improve IME behavior with editors exposing slow or unstable InputConnection selection state, especially Android WebView.

Changes:

  • add a debug-only local WebView compatibility fixture;
  • move selected-text InputConnection reads off the IME UI thread;
  • use EditorInfo initial selection where available;
  • track editor selection updates explicitly;
  • restore the analyzed selection range before commitText();
  • reject stale selection ranges before applying corrections;
  • make the late-selection E2E test synchronize on stable IME visibility rather than transient UI state;
  • document WebView compatibility testing.

Validated locally with:

  • make check
  • make assemble
  • targeted ImeInputConnectionEndToEndTest
  • full :app:connectedDebugAndroidTest
  • Samsung Galaxy S21 / Android 15
  • Android System WebView 154.0.8037.57

Manual WebView validation:

  • IME remains responsive;
  • selected text can be analyzed;
  • corrected text is committed successfully;
  • stale selections are not blindly reused.

@zefutoff
zefutoff merged commit c69af20 into main Oct 6, 2026
4 checks passed
@zefutoff
zefutoff deleted the fix/ime-selection-jank branch October 6, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant