-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
androidIssues specific to AndroidIssues specific to Androidarea: material/inputneeds: clarificationThe issue does not contain enough information for the team to determine if it is a real bugThe issue does not contain enough information for the team to determine if it is a real bug
Description
Reproduction
On mobile devices we often have text fields for example in case of search bar, where we want the form to be submitted when user hits enter key or search button on keyboard. When using normal HTML input, pressing enter/search button automatically submits the form and hides the keyboard.
When using matInput, though pressing enter/search button does submit the form but it doesn't hides the keyboard.
<form [formGroup]="form" (ngSubmit)="search()">
<mat-form-field class="mat-form-field-full-width">
<input matInput formControlName="keywords" type="search" placeholder="Title">
</mat-form-field>
</form>
Expected Behavior
When using matInput, pressing enter/search button should hide the keyboard.
Actual Behavior
The keyboard remains visible although the form is submitted.
Environment
- Angular: 9.x
- CDK/Material:9.x
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Android
Metadata
Metadata
Assignees
Labels
androidIssues specific to AndroidIssues specific to Androidarea: material/inputneeds: clarificationThe issue does not contain enough information for the team to determine if it is a real bugThe issue does not contain enough information for the team to determine if it is a real bug