Within my package.json file, I have specified the version
@angular/material": "^13.3.8"
, however, I am currently utilizing version 13.3.7 along with Angular CLI: 13.3.7
. After copying the necessary codes from Angular Material and importing MatInputModule
into my app.module.ts
, I encountered an issue where the mat-form-field is not displaying properly in the browser. In order for it to appear, I must click on the input area first. This behavior can be seen in the images below:
Prior to clicking on the mat-form-field
https://i.sstatic.net/Jgg51.jpg
After clicking on the mat-form-field
https://i.sstatic.net/ByrR3.jpg
To address this problem, how can I resolve it? Provided below is a snippet of my code:
product.component.html
<div class="example-container">
<mat-form-field class="example-full-width" appearance="fill">
<mat-label>Filter</mat-label>
<input matInput placeholder="Search...">
</mat-form-field>
</div>
app.module.ts
BrowserModule,
AppRoutingModule,
NgbModule,
BrowserAnimationsModule,
MatTableModule,
MatCardModule,
MatPaginatorModule,
MatInputModule,
MatIconModule,
MatButtonModule,
FormsModule,
FontAwesomeModule,
MatFormFieldModule,
ReactiveFormsModule