diff --git a/js/components/text_input.js b/js/components/text_input.js index dd20ea09..ea210cb0 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -31,7 +31,7 @@ export default { type: Boolean, default: false, }, - optional: Boolean, + insetForm: Boolean, }, data: function() { @@ -58,7 +58,11 @@ export default { mounted: function() { if (this.value) { - this._checkIfValid({ value: this.value, invalidate: true }) + this._checkIfValid({ + value: this.value, + invalidate: true, + showValidationIcon: !this.insetForm, + }) if (this.mask && this.validation !== 'email') { const mask = @@ -109,7 +113,11 @@ export default { }, // - _checkIfValid: function({ value, invalidate = false }) { + _checkIfValid: function({ + value, + invalidate = false, + showValidationIcon = true, + }) { const valid = this._isValid(value) if (this.modified) { this.validationError = inputValidations[this.validation].validationError @@ -121,7 +129,10 @@ export default { } else if (invalidate) { this.showError = true } - this.showValid = this.value != '' && valid + + if (showValidationIcon) { + this.showValid = this.value != '' && valid + } // Emit a change event emitEvent('field-change', this, { diff --git a/templates/components/text_input.html b/templates/components/text_input.html index 1b7e5aa7..51528970 100644 --- a/templates/components/text_input.html +++ b/templates/components/text_input.html @@ -17,7 +17,8 @@ optional=True, showLabel=True, watch=False, - show_validation=True) -%} + show_validation=True, + inset_form=False) -%} diff --git a/templates/portfolios/admin.html b/templates/portfolios/admin.html index a4268f44..d451c9df 100644 --- a/templates/portfolios/admin.html +++ b/templates/portfolios/admin.html @@ -17,7 +17,7 @@ {{ portfolio_form.csrf_token }}
- {{ TextInput(portfolio_form.name, validation="portfolioName") }} + {{ TextInput(portfolio_form.name, validation="portfolioName", inset_form=True) }}
{{ SaveButton(text='Save', additional_classes='usa-button-big') }} diff --git a/templates/portfolios/applications/settings.html b/templates/portfolios/applications/settings.html index 4fe5f75a..4e7f0047 100644 --- a/templates/portfolios/applications/settings.html +++ b/templates/portfolios/applications/settings.html @@ -25,8 +25,8 @@

- {{ TextInput(application_form.name) }} - {{ TextInput(application_form.description, paragraph=True) }} + {{ TextInput(application_form.name, inset_form=True) }} + {{ TextInput(application_form.description, paragraph=True, inset_form=True) }}
{% if user_can(permissions.DELETE_APPLICATION) %}