Skip to content

Show InputDecoration.errorText when the field is disabled in M2 - #191662

Closed
kaluli123123 wants to merge 1 commit into
flutter:masterfrom
kaluli123123:fix-disabled-errortext-67409
Closed

kaluli123123 wants to merge 1 commit into
flutter:masterfrom
kaluli123123:fix-disabled-errortext-67409

Conversation

@kaluli123123

Copy link
Copy Markdown
Contributor

_InputDecoratorDefaultsM2.errorStyle resolved the error text color to
Colors.transparent for the disabled state. The subtext row is still laid
out for the error, so a disabled field with an errorText reserved space
below the input but painted nothing, leaving an unexplained gap.

The Material 3 defaults already paint the error text with the error
color in every state. This change removes the disabled special case from
the Material 2 defaults so both align, and the space that is reserved
for the error is used by the visible error text.

Fixes #67409

Pre-launch Checklist

_InputDecoratorDefaultsM2.errorStyle resolved the error text color to
Colors.transparent for the disabled state. The subtext row is still laid
out for the error, so a disabled field with an errorText reserved space
below the input but painted nothing, leaving an unexplained gap.

The Material 3 defaults already paint the error text with the error
color in every state. This change removes the disabled special case from
the Material 2 defaults so both align, and the space that is reserved
for the error is used by the visible error text.

Fixes flutter#67409
@github-actions

Copy link
Copy Markdown

This pull request contains changes to Material or Cupertino, which are currently frozen in this repository.

Changes should be made in material_ui and/or cupertino_ui in the flutter/packages repository.

Please refer to #188444 for instructions.

@github-actions github-actions Bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages labels Aug 25, 2026
@kaluli123123

Copy link
Copy Markdown
Contributor Author

Material is frozen in flutter/flutter (see #188444), so this is ported to flutter/packages instead: flutter/packages#12589. Closing this in favor of that PR.

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

Labels

a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabled TextField InputDecoration errorText allocates space but is not shown

1 participant