Skip to content

Fix autocorrect not being applied in the editor on Samsung devices - #1841

Open
joashrajin wants to merge 1 commit into
trunkfrom
fix/samsung-keyboard-autocorrect
Open

Fix autocorrect not being applied in the editor on Samsung devices#1841
joashrajin wants to merge 1 commit into
trunkfrom
fix/samsung-keyboard-autocorrect

Conversation

@joashrajin

@joashrajin joashrajin commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Supersedes #1840 — moved from a fork branch to an in-repo branch so Buildkite CI (Build and Test, Lint, Prototype Build) can run.

Fix

On Samsung devices the note editor installs a custom SamsungInputConnection (gated on manufacturer == samsung && SDK_INT >= 33 && keyboard startsWith com.samsung.android.honeyboard). Its commitText() override swallows every spellcheck/autocorrect commit that carries a SuggestionSpan — copying the spans onto the existing text instead of letting the keyboard replace it. That workaround was added in early 2023 (ec90ef2, 42ca1bc) to stop the in-keyboard Grammarly component on One UI 5.0 / Android 13 from corrupting checklist (CheckableSpan) spans and the cursor.

Video of the issue:

1000181860.mp4

The gate has no upper bound, so it still activates on One UI 7/8 (e.g. Galaxy S25, Android 16). There it fires on ordinary prose too, which means autocorrect-on-space is never applied and typos "stick" instead of being corrected. Samsung removed the in-keyboard Grammarly plugin in 2024 (One UI 7+ moved spell/grammar to keyboard-agnostic Galaxy AI Writing Assist), so the original trigger no longer exists — but the interception keeps degrading normal typing.

This change scopes the protective path to where it's actually needed: commitText() only takes the span-copy branch when the edited region (the composing region, or the selection when there is none) actually contains a CheckableSpan. Otherwise it forwards to the keyboard's normal commit, restoring standard autocorrect/suggestions. Checklist protection is unchanged where checklists are being edited.

Confirmed on a Galaxy S25 Ultra (SM-S938B, Android 16) via the in-app log (Settings → Send logs): Detected spellchecker trying to commit partial text with suggestions fired twice while typing plain prose with no checkboxes in the note — i.e. the old code was suppressing autocorrect with nothing to protect.

Test

Requires a Samsung device on Android 13+ with the Samsung (Honeyboard) keyboard as default. Galaxy S25 / One UI 7-8 reproduces the original bug best.

Autocorrect now works (the fix):

  1. Open a note without any checklist items and tap into the body.
  2. Type a misspelling followed by a space, e.g. teh or recieve .
  3. ✅ It is autocorrected (the, receive) just like in other apps. (Before this change the typo stayed as typed.)
  4. Optional: Settings → Send logs — Detected spellchecker trying to commit partial text with suggestions should not appear for this plain-text editing.

Checklist protection still works (no regression):

  1. In a note, insert a checklist and put the cursor on a checklist line.
  2. Type a misspelling + space on that line.
  3. ✅ The checkbox stays intact (not duplicated, not reverted to - [ ] markdown), and the log line does appear for that line.
  4. Toggle checkboxes and save/reopen the note — content round-trips correctly.

Also worth a quick smoke test on a non-Samsung device (or Samsung + Gboard) to confirm unchanged behavior — those configs never use SamsungInputConnection.

Review

One developer review is sufficient. The change is isolated to SamsungInputConnection.commitText() plus a new private helper editedRegionHasCheckableSpan(). Key thing to sanity-check: the region used for the CheckableSpan lookup (composing region, falling back to selection, clamped/normalized) matches the region the framework would replace. On-device verification on a modern Samsung phone is the real proof, since this is IME-timing-sensitive code that can't be fully covered by unit tests.

Release

RELEASE-NOTES.txt was updated with:

Fixed autocorrect not being applied in the editor on Samsung devices

(Added to the top 2.38 section to follow the existing convention — feel free to move it to the appropriate in-development version section if 2.38 is already cut.)

SamsungInputConnection.commitText() suppressed every spellcheck/autocorrect
commit that carried a SuggestionSpan, in order to protect checklist
(CheckableSpan) spans from being corrupted when the Samsung keyboard replaced
editor content.

On One UI 7/8 (e.g. Galaxy S25, Android 16) this fires on ordinary prose too,
so autocorrect-on-space is never applied and typos "stick" instead of being
corrected. The bug it originally guarded against was tied to the in-keyboard
Grammarly plugin that Samsung removed in 2024.

Only take the protective path when the edited region (the composing region, or
the selection when there is none) actually contains a CheckableSpan; otherwise
forward to the keyboard's normal commit so autocorrect works. Checklist
protection is unchanged where it is actually needed.
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📲 You can test the changes from this Pull Request in Simplenote Android by scanning the QR code below to install the corresponding build.

App NameSimplenote Android
Build TypeDebug
Commit79e6df5
Direct Downloadsimplenote-android-prototype-build-pr1841-79e6df5-019f1372-1267-42a1-a05a-13e97553c307.apk

@joashrajin joashrajin self-assigned this Jun 29, 2026
@joashrajin joashrajin added [Type] Bug Something isn't working. Samsung labels Jun 29, 2026
@joashrajin joashrajin added this to the Future milestone Jun 29, 2026
@joashrajin
joashrajin requested a review from mzorz June 29, 2026 13:11
@joashrajin

Copy link
Copy Markdown
Contributor Author

How it works now with the fix:

Screen_Recording_20260629_194056_Simplenote.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Samsung [Type] Bug Something isn't working.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants