Skip to content

Warning when changing the type and value of an input field #6441

@mathisonian

Description

@mathisonian

In my render method I have something like

<input type={dynamicTypeValue} value={dynamicValue} />

If I first render this input as a number, (e.g. dynamicTypeValue = 'number'; dynamicValue = 5) but then change the input to a string: (dynamicTypeValue = 'string'; dynamicValue = '01/01/2016') I get a warning
that the new value is not a valid number:

The specified value "01/01/2000" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?
DOMPropertyOperations.js:142 The specified value "01/01/2012" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?

screen shot 2016-04-07 at 6 07 45 pm

Is this expected behavior?

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