Skip to content

Commit 98e4855

Browse files
author
Marco Cesarato
committed
fix: check onsubmit props
1 parent bd1dd64 commit 98e4855

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,13 @@ class InputSpinner extends Component {
223223

224224
/**
225225
* On Submit keyboard
226-
* @param NativeEvent
227-
* @returns {*}
226+
* @returns {*}
227+
* @param e
228228
*/
229-
230229
onSubmit(e){
231-
this.props.onSubmit(this.parseNum(e.nativeEvent.text))
230+
if (this.props.onSubmit) {
231+
this.props.onSubmit(this.parseNum(e.nativeEvent.text));
232+
}
232233
}
233234

234235

0 commit comments

Comments
 (0)