@@ -5,6 +5,16 @@ An es6 react component for currency. Supports custom decimal and thousand separ
5
5
[ ![ Build Status] ( https://travis-ci.org/jsillitoe/react-currency-input.svg?branch=master )] ( https://travis-ci.org/jsillitoe/react-currency-input )
6
6
7
7
8
+ ## Changes
9
+
10
+ V1.3.0:
11
+ -------
12
+ * Depecrated "onChange" option in favor of "onChangeEvent". This fixes the argument order to better match React's default input handling
13
+ * Updated dependencies to React 15
14
+ * Added parseFloat polyfill
15
+ * Persist events to deal with an issue of event pooling
16
+ * Other bug fixes.
17
+
8
18
## Installation
9
19
```
10
20
npm install react-currency-input --save
@@ -24,13 +34,13 @@ const MyApp = React.createClass({
24
34
return ({amount: " 0.00" });
25
35
},
26
36
27
- handleChange (newValue ){
28
- this .setState ({amount: newValue });
37
+ handleChange (event , maskedvalue , floatvalue ){
38
+ this .setState ({amount: maskedvalue });
29
39
},
30
40
render () {
31
41
return (
32
42
< div>
33
- < CurrencyInput value= {this .state .amount } onChange = {this .handleChange }/ >
43
+ < CurrencyInput value= {this .state .amount } onChangeEvent = {this .handleChange }/ >
34
44
< / div>
35
45
);
36
46
}
@@ -121,7 +131,8 @@ All other attributes are applied to the input element. For example, you can int
121
131
| Option | Default Value | Description |
122
132
| ------------- | ----------- | ----------- |
123
133
| value | 0 | The initial currency value |
124
- | onChange | n/a | Callback function to handle value changes |
134
+ | onChange | n/a | Callback function to handle value changes. Deprecated, use onChangeEvent. |
135
+ | onChangeEvent | n/a | Callback function to handle value changes |
125
136
| precision | 2 | Number of digits after the decimal separator |
126
137
| decimalSeparator | '.' | The decimal separator |
127
138
| thousandSeparator | ',' | The thousand separator |
0 commit comments