rc-input-number
Advanced tools
Comparing version 2.5.4 to 2.5.5
@@ -114,8 +114,27 @@ 'use strict'; | ||
onBlur: function onBlur(event) { | ||
var props = this.props; | ||
var val = event.target.value.trim(); | ||
onBlur: function onBlur(e) { | ||
var _props3; | ||
this.setState({ | ||
focused: false | ||
}); | ||
var value = this.getCurrentValidValue(e.target.value.trim()); | ||
this.setValue(value); | ||
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
(_props3 = this.props).onBlur.apply(_props3, [e].concat(args)); | ||
}, | ||
onStepMouseDown: function onStepMouseDown(e) { | ||
e.preventDefault(); | ||
var value = this.getCurrentValidValue(this.state.inputValue); | ||
this.setState({ value: value }); | ||
}, | ||
getCurrentValidValue: function getCurrentValidValue(value) { | ||
var val = value; | ||
var props = this.props; | ||
if (val === '') { | ||
@@ -134,9 +153,3 @@ val = ''; | ||
} | ||
this.setValue(val); | ||
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
props.onBlur.apply(props, [event].concat(args)); | ||
return val; | ||
}, | ||
@@ -277,3 +290,3 @@ | ||
onClick: upDisabledClass ? noop : this.up, | ||
onMouseDown: preventDefault, | ||
onMouseDown: this.onStepMouseDown, | ||
className: prefixCls + '-handler ' + prefixCls + '-handler-up ' + upDisabledClass }, | ||
@@ -287,3 +300,3 @@ _react2['default'].createElement('span', { unselectable: 'unselectable', className: prefixCls + '-handler-up-inner', | ||
ref: 'down', | ||
onMouseDown: preventDefault, | ||
onMouseDown: this.onStepMouseDown, | ||
onClick: downDisabledClass ? noop : this.down, | ||
@@ -290,0 +303,0 @@ className: prefixCls + '-handler ' + prefixCls + '-handler-down ' + downDisabledClass }, |
{ | ||
"name": "rc-input-number", | ||
"version": "2.5.4", | ||
"version": "2.5.5", | ||
"description": "input-number ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19394
378