From 12a1ad180aa9bcf19ff2361630f33fdb3e3fb595 Mon Sep 17 00:00:00 2001 From: Comus Leong Date: Sat, 7 Jan 2017 00:12:11 +0800 Subject: [PATCH] check onChange exists before call it --- imports/ui/components/Field.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/ui/components/Field.jsx b/imports/ui/components/Field.jsx index 5741dd1..9222412 100644 --- a/imports/ui/components/Field.jsx +++ b/imports/ui/components/Field.jsx @@ -12,7 +12,7 @@ export class Field extends React.Component { triggerUpdate() { // Trigger an onChange on inital load, to support browser prefilled values. const { onChange } = this.props; - if (this.input && this.input.value) { + if (this.input && this.input.value && onChange) { onChange({ target: { value: this.input.value } }); } }