Reputation: 809
I'm developing a web application and all of a sudden the form material inputs stopped rendering correctly in one component only:
Here's how they look in other components (expected and correct output):
Sample code for output above: Wrong output (the first image):
<mat-form-field>
<mat-label>Oggetto</mat-label>
<input matInput placeholder="Oggetto" formControlName="oggetto">
</mat-form-field>
sample code for second image(works well):
<mat-form-field>
<mat-label>Nome</mat-label>
<input matInput placeholder="Nome" formControlName="name">
</mat-form-field>
Note that the console doesn't show any errors. Happy to give more context if needed
Upvotes: 1
Views: 5210
Reputation: 809
Found the answer: I was trying to set
overflow:hidden
on the html tag and accidentally set
encapsulation: ViewEncapsulation.ShadowDom
on the component. I removed that line and now it's working again.
Upvotes: 1