Skip to content

BUG: input type="number" #9712

Closed
Closed

Description

@pingan1927
render () {
  <input type="number" value={this.props.value} />
}

for example, when the original value is '.98', we need format it to '0.98'. but it is not take effect。

class Test extends React.Component {
 state = {
    value: '.98',
  }
 changeValue = () => {
    alert(0.98);
    this.setState({
      value: '0.98',
    });
  }

 render() {
    return <div>
      <input type="number" value={this.state.value} />
      <button onClick={this.changeValue}>changeValue</button>
    </div>;
  }
}

ReactDOM.render(<Test />, mountNode);

Activity

  1. changed the title [-]input type="number"[/-] [+]BUG: input type="number"[/+] on May 18, 2017
  2. added 2 commits that reference this issue on May 18, 2017
  3. pingan1927 commented on Jun 9, 2017

    @pingan1927
    ContributorAuthor

    your example is not same with mine. the key is .98 can't be formated to 0.98. Because as number they are equal.

  4. added a commit that references this issue on Jun 9, 2017
  5. added 2 commits that reference this issue on Jun 12, 2017
  6. nhunzaker commented on Jun 13, 2017

    @nhunzaker
    Contributor

    @aweary Just housekeeping. Do we close out issues before a release with the fix has shipped or wait?

  7. aweary commented on Jun 13, 2017

    @aweary
    Contributor

    @nhunzaker typically I close the issue once the has been merged into master 👍

  8. nhunzaker commented on Jun 13, 2017

    @nhunzaker
    Contributor

    Awesome, thanks! @pingan1927 This should land in the next minor release of React: 15.6.0

  9. added a commit that references this issue on Jun 25, 2026
  10. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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