Skip to content

Commit f9f7aca

Browse files
committed
Fixed #4: NumberFormat was not updating on props other than value change
1 parent 8b76b63 commit f9f7aca

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
lines changed

dist/react-number-format.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* react-number-format - 0.1.2
2+
* react-number-format - 0.1.3
33
* Author : Sudhanshu Yadav
44
* Copyright (c) 2016 to Sudhanshu Yadav - ignitersworld.com , released under the MIT license.
55
*/
@@ -89,9 +89,6 @@ return /******/ (function(modules) { // webpackBootstrap
8989
value: this.formatInput(newProps.value).formattedValue
9090
});
9191
},
92-
shouldComponentUpdate: function shouldComponentUpdate(newProps) {
93-
return !(newProps !== this.props && newProps.value === this.props.value);
94-
},
9592
setCaretPosition: function setCaretPosition(caretPos) {
9693
var el = this.refs.input;
9794
el.value = el.value;

dist/react-number-format.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/number_format.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ var NumberFormat = React.createClass({
2121
value: this.formatInput(newProps.value).formattedValue
2222
});
2323
},
24-
shouldComponentUpdate: function shouldComponentUpdate(newProps) {
25-
return !(newProps !== this.props && newProps.value === this.props.value);
26-
},
2724
setCaretPosition: function setCaretPosition(caretPos) {
2825
var el = this.refs.input;
2926
el.value = el.value;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-number-format",
33
"description": "React component to format number in an input or as a text.",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"main": "lib/number_format.js",
66
"author": "Sudhanshu Yadav",
77
"license": "MIT",

src/number_format.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ const NumberFormat = React.createClass({
1717
value : this.formatInput(newProps.value).formattedValue
1818
});
1919
},
20-
shouldComponentUpdate:function(newProps){
21-
return !(newProps!==this.props && newProps.value === this.props.value);
22-
},
2320
setCaretPosition : function(caretPos) {
2421
const el = this.refs.input;
2522
el.value = el.value;

0 commit comments

Comments
 (0)