Skip to content

bug(input): only apply MatInput styles when inside of a form-field #21871

Closed
@jelbourn

Description

@jelbourn

MatFormFieldincludes styles that affect theMatInputelement inside. However, some people useMatInput(such as withMatChipInput) without MatFormField, meaning that the styles only apply when some other MatFormField` appears on the page.

We should conditionally apply the MatInput CSS class used for styling based on whether it actually appears inside of a MatFormField. We probably want to leave the existing class as-is and move the styles to a new conditional class, since that will be the least breaking. This is still a potentially breaking change, though, so we'll have to see how severely this breaks apps inside of Google.

Metadata

Metadata

Assignees

Labels

GThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/form-fieldarea: material/input

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions