From ec7ae7aa46135942bb8d2ca6f273778694be1032 Mon Sep 17 00:00:00 2001 From: Mark Goldberg Date: Fri, 17 Jul 2015 10:57:25 -0400 Subject: [PATCH] Allow onChange prop to take the component's internal InputMask as an argument --- src/index.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index 5132bac..c573263 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -75,7 +75,7 @@ var MaskedInput = React.createClass({ } } if (this.props.onChange) { - this.props.onChange(e) + this.props.onChange(e, this.mask) } }, @@ -87,7 +87,7 @@ var MaskedInput = React.createClass({ if (this.mask.undo()) { e.target.value = this._getDisplayValue() this._updateInputSelection() - this.props.onChange(e) + this.props.onChange(e, this.mask) } return } @@ -96,7 +96,7 @@ var MaskedInput = React.createClass({ if (this.mask.redo()) { e.target.value = this._getDisplayValue() this._updateInputSelection() - this.props.onChange(e) + this.props.onChange(e, this.mask) } return } @@ -110,7 +110,7 @@ var MaskedInput = React.createClass({ if (value) { this._updateInputSelection() } - this.props.onChange(e) + this.props.onChange(e, this.mask) } } }, @@ -140,7 +140,7 @@ var MaskedInput = React.createClass({ e.target.value = this.mask.getValue() // Timeout needed for IE setTimeout(this._updateInputSelection, 0) - this.props.onChange(e) + this.props.onChange(e, this.mask) } },