Skip to content

Using a mat-autocomplete on an input field of type "number" #9628

@joshuaball

Description

@joshuaball

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Input fields that are of type "number" should not have their data converted to a "string" type.

What is the current behavior?

When using a mat-autocomplete on an input field of type "number", the data in the field is converted from a number to a string when the user types in the input field or uses the number wheel. An input field without a mat-autocomplete provides data in the format expected. This is using the get API of the FormGroup from "@angular/forms".

What are the steps to reproduce?

See the current behavior above. Here is a SlackBitz:
https://stackblitz.com/edit/angular-material2-issue-mat-autocomplete

What is the use-case or motivation for changing an existing behavior?

Data integrity

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 5.2.1
Angular Material: 5.1.0

Is there anything else we should know?

Give it a whirl.

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions