Skip to content

hintStyle of InputDecorationTheme not correctly applied #21385

Closed
@fhuonder

Description

@fhuonder

Hi all,

When having a custom theme with a custom InputDecorationTheme, like

new ThemeData(
    //...
    inputDecorationTheme: const InputDecorationTheme(
      focusedBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.red)),
      enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.yellow)),
      labelStyle: TextStyle(color: Colors.yellow),
      hintStyle: TextStyle(color: Colors.red),
    ));

my expectation, according to the documentation of the hintStyle property, is that the label text of a focused text field gets the color of the hint style. Unfortunately it stays the color of the labelStyle. When no custom InputDecorationTheme is in use it works.


With custom theme (expectation: in the focused case the text 'Place' should be red):
custom_theme


Without custom theme (where primary color is cyan and accent color is purple):
no_custom_theme


Is the configuration wrong or is it really a bug?

Regards,
Florian

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencea: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions