components icon indicating copy to clipboard operation
components copied to clipboard

Form field and button in the same row but inconsistent height across variants of form field

Open soorireddy opened this issue 5 years ago • 6 comments

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue

would like to implement row with form fields and button with same height. image

Steps to reproduce:

  1. https://angular-ivy-qdy6pn.stackblitz.io
  2. Pure angular stack ( no custom styles) angular , material , flex

Expected Behavior

What behavior were you expecting to see? it requires to write lot of custom styles for each variant and button. ( not maintainable) one custom style should work across all variants of form fields and should handle height of buttons and fom-field.

Actual Behavior

What behavior did you actually see? image

.mat-form-field-appearance-legacy .mat-form-field-wrapper { padding-bottom: 1.25em; }

.mat-form-field-appearance-standard .mat-form-field-flex { padding-top: .75em; }

.mat-form-field-appearance-fill .mat-form-field-flex { border-radius: 4px 4px 0 0; padding: .75em .75em 0 .75em; }

.mat-form-field-appearance-outline .mat-form-field-infix { padding: 0.75em 0 0.75em 0 !important; }

.mat-form-field-appearance-legacy .mat-form-field-infix { padding-top: 0.75em !important; }

.mat-form-field-appearance-legacy .mat-form-field-wrapper { padding-bottom: 1.75em; }

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):

soorireddy avatar Aug 25 '20 17:08 soorireddy

I believe that the current form field is set up to have a consistent baseline relative to other form fields, but not necessarily buttons and other Material components. Hopefully this will be better with the MDC-based versions.

crisbeto avatar Aug 30 '20 09:08 crisbeto

When testing with the MDC based form field and button components, the heights are still different

amysorto avatar Nov 07 '22 22:11 amysorto

Any updates on this?

vytautas-pranskunas- avatar Nov 20 '22 11:11 vytautas-pranskunas-

How can this not be a thing?

Snawe avatar Jun 08 '23 10:06 Snawe

Still nothing? So button is not considered as form field?

adurmus avatar Nov 17 '23 11:11 adurmus