Skip to content

Input [v-model & type=number] is truncated when (unrelated) DOM update happens. #4392

Closed
@patrickb1991

Description

@patrickb1991

Vue.js version

v2.1.3

Reproduction Link

http://jsfiddle.net/1y2nk1L9/5/

Steps to reproduce

Enter a number with some zeros after the comma into a type="number" input field, while Vue performs some page rendering in the background with (unrelated) variables of the same component.

What is Expected?

Entering a number like 1.00001 works without issues.

What is actually happening?

Every time Vue triggers a DOM change all v-model input fields are "re-rendered" ("0.000" -> "0") which makes it impossible to enter decimal numbers that contain zeros in busy components. While this sounds like a minor issue it is a huge problem, since the entered number could be completely wrong. Imagine entering 1.00345, but the input is silently changed to 1345. This has already led to some serious trouble in our (financial) Vue application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions