From 2c895a250f116d3bbf312dd6295018a23146a206 Mon Sep 17 00:00:00 2001 From: PolGuixe Date: Thu, 19 Jan 2017 12:42:07 -0500 Subject: [PATCH] improving fix in issue #4 --- fix.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/fix.js b/fix.js index 9f6a993..ab92f80 100644 --- a/fix.js +++ b/fix.js @@ -4,22 +4,24 @@ import {Accounts, STATES} from 'meteor/std:accounts-ui'; class Field extends Accounts.ui.Field { - triggerUpdate() { - const {onChange} = this.props - let value = this.input.value; + triggerUpdate() { + const {onChange} = this.props; + let value; + if(this.input) { + value = this.input.value; + } + if (value === undefined) { + value = ''; + } else { + // do nothing + } - if (value === undefined) { - value = ''; - } else { - // do nothing - } - - if (this.input) { - onChange({target: { - value - }}) - } - } + if (this.input) { + onChange({target: { + value + }}) + } + } } Accounts.ui.Field = Field;