Skip to content

Issues with label and md-input type="Number" #2092

Open
@JerichoKain

Description

@JerichoKain

Steps to reproduce

  1. Start with a md-field with a label and <md-input v-model="num" type="Number">.
  2. Make the field an invalid number (e.g. 11.11.11). The md-input's v-model num will be cleared and treated as if there is no value while the inner input element maintains a value
  3. Remove focus from the field. Because the v-model has been cleared, the input treats it as empty and shows the label as a placeholder covering the invalid input.

Further inspection shows that the value in the $el.value is maintained, only the v-model is not.

Which browser?

Chrome: 75
Firefox: 66
Vue: ^2.6.10
Vue Material: ^1.0.0-beta11

What is expected?

The v-model value should not be cleared and the label should not cover the input value.

What is actually happening?

The v-model is cleared and the label acts as if there are no values in the the md-field.

Reproduction Link

https://codesandbox.io/s/vue-material-quick-start-l55e4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions