diff --git a/app/javascript/controllers/email_france_connect_controller.ts b/app/javascript/controllers/email_france_connect_controller.ts index 1321baea0..d9be703af 100644 --- a/app/javascript/controllers/email_france_connect_controller.ts +++ b/app/javascript/controllers/email_france_connect_controller.ts @@ -20,10 +20,12 @@ export class EmailFranceConnectController extends ApplicationController { ) as HTMLInputElement; if (checkedTarget && checkedTarget.value === 'false') { - this.emailFieldTarget.classList.remove('fr-hidden'); + this.emailFieldTarget.classList.remove('hidden'); + this.emailFieldTarget.setAttribute('aria-hidden', 'false'); inputElement.setAttribute('required', ''); } else { - this.emailFieldTarget.classList.add('fr-hidden'); + this.emailFieldTarget.classList.add('hidden'); + this.emailFieldTarget.setAttribute('aria-hidden', 'true'); inputElement.removeAttribute('required'); inputElement.value = ''; } diff --git a/app/views/france_connect/particulier/choose_email.html.haml b/app/views/france_connect/particulier/choose_email.html.haml index 6bf3def08..d1e6d9467 100644 --- a/app/views/france_connect/particulier/choose_email.html.haml +++ b/app/views/france_connect/particulier/choose_email.html.haml @@ -22,7 +22,7 @@ %label.fr-label.fr-text--wrap{ for: 'use_france_connect_email_no' } = t('.use_another_email') - .fr-fieldset__element.fr-fieldset__element--inline.fr-hidden{ data: { email_france_connect_target: "emailField", controller: 'email-input', email_input_url_value: show_email_suggestions_path } } + .fr-fieldset__element.fr-fieldset__element--inline.hidden{ aria: { hidden: true }, data: { email_france_connect_target: "emailField", controller: 'email-input', email_input_url_value: show_email_suggestions_path } } = f.label :email, t('.alternative_email'), class: "fr-label" %span.fr-hint-text.mb-1= t('activerecord.attributes.user.hints.email') = f.email_field :email, class: "fr-input"