Skip to content

TextInputLayout outline mode does not support dynamic boxBackgroundColor via ColorStateList #4958

@reiser002

Description

@reiser002

Issue Summary

When using TextInputLayout with boxBackgroundMode="outline", the boxBackgroundColor does not respond to ColorStateList changes. This makes it impossible to change the background color dynamically on focus, unlike filled mode which works as expected.

Steps to Reproduce

  1. Create a selector color resource with state_focused and default.
  2. Set it to app:boxBackgroundColor in XML.
  3. Use boxBackgroundMode="outline".

Expected Behavior

The background color of the outlined box should change when focused.

Actual Behavior

Only the default color is applied. Focused state is ignored.

Environment

  • Material Components version: [your version]
  • Android version: [your device/emulator]
  • Theme: Material3 / Material2

Additional Notes

This behavior is inconsistent with filled mode and limits UI flexibility. Please consider adding support for ColorStateList in outline mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions