I'm experiencing an issue while trying to style a specific form field in Angular 7. The style doesn't seem to be applying properly.
Below is my form structure:
<ul>
<li>
<mat-form-field *ngIf="number">
<input matInput disabled [value]="number">
</mat-form-field>
<mat-form-field *ngIf="name">
<input name="address" matInput disabled [value]="building.name">
</mat-form-field>
</li>
</ul>
The goal is to have the number field with a width of 200px and the name field occupying the remaining available space.
Here's the relevant CSS code:
.mat-form-field {
display: inline-block;
position: relative;
text-align: left;
width: 200px;
}
:host ::ng-deep input.mat-input-element[name=address] {
width: 100%;
}
Currently, both fields are taking up 200px, causing the value in the name field to get clipped. It is not expanding to fit the size of the value as intended.