Skip to content

fix(input): enable auto-correction for standard single-line text fields - #783

Merged
LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
R0STEFAN:fix/autocorrect-single-line-inputs
Nov 9, 2026
Merged

LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
R0STEFAN:fix/autocorrect-single-line-inputs

Conversation

@R0STEFAN

@R0STEFAN R0STEFAN commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Problem

In InputAttributes.kt, mInputTypeShouldAutoCorrect strictly required flagMultiLine (TYPE_TEXT_FLAG_MULTI_LINE).
Most modern Android applications (messaging apps like WhatsApp, Telegram, Signal, SMS, notes, search fields, and general single-line inputs) do not provide the multi-line flag. As a result, mInputTypeShouldAutoCorrect evaluated to false for standard text inputs, causing auto-correction to be completely disabled even when enabled in settings (fixes reports such as #481).

Solution

  • Removed the legacy flagMultiLine requirement for auto-correction eligibility.
  • Evaluated mInputTypeShouldAutoCorrect using mIsGeneralTextInput (flagAutoCorrect || (mIsGeneralTextInput && variation != InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT && !flagNoSuggestions)), keeping password, email, URI, and no-suggestion protection fully intact.
  • Added InputAttributesTest unit tests covering single-line, multi-line, passwords, emails, URIs, and suggestion flags.

Previously, mInputTypeShouldAutoCorrect strictly required flagMultiLine, causing auto-correction to be disabled in standard single-line text input fields (e.g. messaging apps, SMS, notes, standard EditTexts) even when auto-correction was enabled in keyboard settings.

This removes the flagMultiLine requirement while continuing to respect mIsGeneralTextInput (which guards passwords, emails, URIs), WEB_EDIT_TEXT, and flagNoSuggestions. Also adds unit tests in InputAttributesTest.
@LeanBitLab
LeanBitLab merged commit 03699eb into LeanBitLab:main Nov 9, 2026
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.

2 participants