From 5b3245c576bcba98984ca3150ae7ecb0497ff528 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 31 Jul 2019 16:57:25 +1000 Subject: [PATCH] Update field validation --- .../javascripts/wizard/initializers/custom.js.es6 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index 3882c6c5..22c7e3bf 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -204,7 +204,18 @@ export default { }.property('field.type', 'field.id') }); - const StandardFieldValidation = ['text', 'textarea', 'dropdown', 'tag', 'category', 'image', 'checkbox', 'user-selector', 'text-only', 'composer']; + const StandardFieldValidation = [ + 'text', + 'textarea', + 'dropdown', + 'tag', + 'category', + 'image', + 'checkbox', + 'user-selector', + 'text-only', + 'composer' + ]; FieldModel.reopen({ hasCustomCheck: false, @@ -230,7 +241,7 @@ export default { if (type === 'checkbox') { valid = val; } else if (StandardFieldValidation.indexOf(type) > -1) { - valid = val && val.length > 0; + valid = val && String(val).length > 0; } }