We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4c4a8d commit 40eece3Copy full SHA for 40eece3
src/input/Input.jsx
@@ -70,17 +70,15 @@ export default class Input extends Component {
70
71
handleBlur(e: SyntheticEvent): void {
72
const { onBlur } = this.props
73
- if (this.props.trim) this.handleTrim(e)
+ if (this.props.trim) this.handleTrim()
74
if (onBlur) onBlur(e)
75
}
76
77
- handleTrim(e: SyntheticEvent): void {
+ handleTrim(): void {
78
+ this.refs.input.value = this.refs.input.value.trim()
79
if(this.props.onChange) {
80
// this's for controlled components
- this.props.onChange(e.target.value.trim())
81
- } else {
82
- // this's for uncontrolled components
83
- this.refs.input.value = this.refs.input.value.trim()
+ this.props.onChange(this.refs.input.value.trim())
84
85
86
0 commit comments