diff --git a/js/components/date_selector.js b/js/components/date_selector.js index 8e8f5327..311d5514 100644 --- a/js/components/date_selector.js +++ b/js/components/date_selector.js @@ -36,6 +36,7 @@ export default { month: this.initialmonth, year: this.initialyear, name: this.nameTag, + showValidation: false, } }, @@ -160,6 +161,8 @@ export default { methods: { onInput: function(e) { + this.showValidation = true + emitEvent('field-change', this, { value: this.formattedDate, name: this.name, diff --git a/js/components/options_input.js b/js/components/options_input.js index 48213378..6c82b39b 100644 --- a/js/components/options_input.js +++ b/js/components/options_input.js @@ -36,7 +36,7 @@ export default { const showError = (this.initialErrors && this.initialErrors.length) || false return { showError: showError, - showValid: !showError && !!this.initialValue, + showValid: false, validationError: this.initialErrors.join(' '), value: this.initialValue, } diff --git a/js/components/text_input.js b/js/components/text_input.js index ea210cb0..92c8c7e4 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -31,7 +31,6 @@ export default { type: Boolean, default: false, }, - insetForm: Boolean, }, data: function() { @@ -61,7 +60,7 @@ export default { this._checkIfValid({ value: this.value, invalidate: true, - showValidationIcon: !this.insetForm, + showValidationIcon: false, }) if (this.mask && this.validation !== 'email') { @@ -103,6 +102,8 @@ export default { onBlur: function(e) { if (!(this.optional && e.target.value === '')) { this._checkIfValid({ value: e.target.value.trim(), invalidate: true }) + } else if (this.modified && !this.optional) { + this._checkIfValid({ value: e.target.value.trim(), invalidate: true }) } this.value = e.target.value.trim() diff --git a/templates/components/date_picker.html b/templates/components/date_picker.html index 61c1889f..2774aec5 100644 --- a/templates/components/date_picker.html +++ b/templates/components/date_picker.html @@ -20,7 +20,7 @@ :optional='{{ optional | string | lower }}' inline-template> -