diff --git a/app/components/validated_field_component.html.erb b/app/components/validated_field_component.html.erb index cea248e0f33..773b559072d 100644 --- a/app/components/validated_field_component.html.erb +++ b/app/components/validated_field_component.html.erb @@ -21,7 +21,7 @@ describedby: aria_describedby_idrefs, }, }, - hint_html: { id: hint_id, class: hint_class }, + hint_html: { id: hint_id }, error_html: { id: error_id }, ), ) %> diff --git a/app/components/validated_field_component.rb b/app/components/validated_field_component.rb index b9e95f3a363..d7e07afb34c 100644 --- a/app/components/validated_field_component.rb +++ b/app/components/validated_field_component.rb @@ -3,11 +3,10 @@ class ValidatedFieldComponent < BaseComponent alias_method :f, :form - def initialize(form:, name:, error_messages: {}, hint_class: nil, **tag_options) + def initialize(form:, name:, error_messages: {}, **tag_options) @form = form @name = name @error_messages = error_messages - @hint_class = hint_class @tag_options = tag_options @input_type = inferred_input_type end @@ -43,10 +42,6 @@ def hint_id "validated-field-hint-#{unique_id}" end - def hint_class - @hint_class || [] - end - private def value_missing_error_message diff --git a/app/views/idv/address/new.html.erb b/app/views/idv/address/new.html.erb index 9e5c9db6869..678af3b98bb 100644 --- a/app/views/idv/address/new.html.erb +++ b/app/views/idv/address/new.html.erb @@ -32,7 +32,7 @@ name: :address1, label: t('idv.form.address1'), hint: @presenter.address_line1_hint, - hint_class: @presenter.hint_class, + hint_html: { class: @presenter.hint_class }, required: true, maxlength: 255, input_html: { value: @presenter.pii['address1'] }, @@ -42,7 +42,7 @@ name: :address2, label: t('idv.form.address2'), hint: @presenter.address_line2_hint, - hint_class: @presenter.hint_class, + hint_html: { class: @presenter.hint_class }, required: false, maxlength: 255, input_html: { value: @presenter.pii['address2'] }, @@ -52,7 +52,7 @@ name: :city, label: t('idv.form.city'), hint: @presenter.city_hint, - hint_class: @presenter.hint_class, + hint_html: { class: @presenter.hint_class }, required: true, maxlength: 255, input_html: { value: @presenter.pii['city'] }, @@ -73,7 +73,7 @@ as: :tel, label: t('idv.form.zipcode'), hint: @presenter.zipcode_hint, - hint_class: @presenter.hint_class, + hint_html: { class: @presenter.hint_class }, required: true, pattern: '(\d{5}([\-]\d{4})?)', input_html: { value: @presenter.pii['zipcode'], class: 'zipcode' },