Ive create a form in a dialog using material forms but I cant seem to get the inputs to be wider than 180px despite following numerous examples including https://material.an
Just like Jonesie said, this behavior is related to View Encapsulation. In this context .mat-form-field-infix
takes 180px
as default value probably beacause of this. The auto
value lets the browser calculates the width instead of puting hardcoded value. The !important
declarations forces the style override for this.
I am using !important
since it complies with the rules for the use of this property. See docs
::ng-deep .mat-form-field-infix {
width: auto !important;
}