Skip to content

Skip the default composing-text style on Android inputs that request no suggestions - #60576

Open
ishsalazar wants to merge 1 commit into
react:mainfrom
ishsalazar:export-D134058397
Open

ishsalazar wants to merge 1 commit into
react:mainfrom
ishsalazar:export-D134058397

Conversation

@ishsalazar

Copy link
Copy Markdown

Summary:
Some keyboards keep composing text even when a TextInput sets autoCorrect={false}, which requests no suggestions. When the keyboard sends plain text, Android's BaseInputConnection applies the theme's default composing style (android:candidatesTextStyleSpans, an underline by default), so the word being typed appears underlined in a field that asked for no suggestions.

Behind a new feature flag, disableDefaultComposingTextStyleWithoutSuggestionsAndroid (off by default), ReactEditText now wraps its InputConnection when its input type has TYPE_TEXT_FLAG_NO_SUGGESTIONS:

  • setComposingText passes plain text on as a Spannable, so the default style isn't added.
  • setComposingRegion removes the default style it applies to the re-composed region.

Composition itself is unchanged, and styling supplied by the keyboard is kept. Inputs that allow suggestions are untouched.

Changelog: [Internal]

Differential Revision: D134058397

…no suggestions

Summary:
Some keyboards keep composing text even when a TextInput sets autoCorrect={false}, which requests no suggestions. When the keyboard sends plain text, Android's BaseInputConnection applies the theme's default composing style (`android:candidatesTextStyleSpans`, an underline by default), so the word being typed appears underlined in a field that asked for no suggestions.

Behind a new feature flag, `disableDefaultComposingTextStyleWithoutSuggestionsAndroid` (off by default), ReactEditText now wraps its InputConnection when its input type has `TYPE_TEXT_FLAG_NO_SUGGESTIONS`:
- `setComposingText` passes plain text on as a Spannable, so the default style isn't added.
- `setComposingRegion` removes the default style it applies to the re-composed region.

Composition itself is unchanged, and styling supplied by the keyboard is kept. Inputs that allow suggestions are untouched.

Changelog: [Internal]

Differential Revision: D134058397
@meta-codesync

meta-codesync Bot commented Dec 4, 2026

Copy link
Copy Markdown

@ishsalazar has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134058397.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant