From eebf4418fe16316c1a038a46dcc8b5a694a7dd34 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 28 Feb 2025 17:22:35 +0100 Subject: [PATCH 1/2] fix(autocomplete): Add attribute to relevant fields when the form is not filled in by a third party --- .../editable_champ/email_component/email_component.html.haml | 2 +- .../editable_champ/pays_component/pays_component.html.haml | 2 +- .../editable_champ/phone_component/phone_component.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/editable_champ/email_component/email_component.html.haml b/app/components/editable_champ/email_component/email_component.html.haml index bf33f199ed8..072a50918ce 100644 --- a/app/components/editable_champ/email_component/email_component.html.haml +++ b/app/components/editable_champ/email_component/email_component.html.haml @@ -1 +1 @@ -= @form.email_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?)) += @form.email_field(:value, input_opts(id: @champ.input_id, autocomplete: @champ.dossier.for_tiers? ? "off" : "email", aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?)) diff --git a/app/components/editable_champ/pays_component/pays_component.html.haml b/app/components/editable_champ/pays_component/pays_component.html.haml index f77019fdaa4..d7253c57bb7 100644 --- a/app/components/editable_champ/pays_component/pays_component.html.haml +++ b/app/components/editable_champ/pays_component/pays_component.html.haml @@ -1 +1 @@ -= @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: "width-33-desktop width-100-mobile fr-select" += @form.select :value, options, select_options, required: @champ.required?, id: @champ.input_id, autocomplete: @champ.dossier.for_tiers? ? "off" : "country-name", aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, class: "width-33-desktop width-100-mobile fr-select" diff --git a/app/components/editable_champ/phone_component/phone_component.html.haml b/app/components/editable_champ/phone_component/phone_component.html.haml index 67a71154d13..a9cfe4f16cb 100644 --- a/app/components/editable_champ/phone_component/phone_component.html.haml +++ b/app/components/editable_champ/phone_component/phone_component.html.haml @@ -1,4 +1,4 @@ -# Allowed @formats: -# very light validation is made client-side -# stronger validation is made server-side -= @form.phone_field(:value, input_opts(id: @champ.input_id, aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?, pattern: "[^a-z^A-Z]+")) += @form.phone_field(:value, input_opts(id: @champ.input_id, autocomplete: @champ.dossier.for_tiers? ? "off" : "tel", aria: { describedby: "#{@champ.describedby_id} #{@champ.error_id}" }, required: @champ.required?, pattern: "[^a-z^A-Z]+")) From 597a92574c02eec680af2c12521933b7e98522c1 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Fri, 28 Feb 2025 17:24:17 +0100 Subject: [PATCH 2/2] fix(autocomplete): Remove attribute on field requesting a third party's email --- app/views/users/dossiers/transferer.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/dossiers/transferer.html.haml b/app/views/users/dossiers/transferer.html.haml index 1a2f54829c8..c751914b7f7 100644 --- a/app/views/users/dossiers/transferer.html.haml +++ b/app/views/users/dossiers/transferer.html.haml @@ -14,7 +14,7 @@ = form_for @transfer, url: transfers_path, class: "fr-mt-4w" do |f| .fr-input-group = f.label :email, t('.email_label'), class: "fr-label" - = f.email_field :email, required: true, class: "fr-input", autocomplete: "email" + = f.email_field :email, required: true, class: "fr-input" = f.hidden_field :dossier, value: @dossier.id = f.submit t('.submit'), class: 'fr-btn'