Repository navigation
fix(input): enable auto-correction for standard single-line text fields - #783
Merged
LeanBitLab merged 1 commit intoNov 9, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
InputAttributes.kt,mInputTypeShouldAutoCorrectstrictly requiredflagMultiLine(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,
mInputTypeShouldAutoCorrectevaluated tofalsefor standard text inputs, causing auto-correction to be completely disabled even when enabled in settings (fixes reports such as #481).Solution
flagMultiLinerequirement for auto-correction eligibility.mInputTypeShouldAutoCorrectusingmIsGeneralTextInput(flagAutoCorrect || (mIsGeneralTextInput && variation != InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT && !flagNoSuggestions)), keeping password, email, URI, and no-suggestion protection fully intact.InputAttributesTestunit tests covering single-line, multi-line, passwords, emails, URIs, and suggestion flags.