diff --git a/app/assets/stylesheets/new_design/labels.scss b/app/assets/stylesheets/new_design/labels.scss index 2d3252355..fa57a3a1a 100644 --- a/app/assets/stylesheets/new_design/labels.scss +++ b/app/assets/stylesheets/new_design/labels.scss @@ -55,3 +55,17 @@ @extend .without-continuation; } } + +// Labels that we only want for screen readers +// https://www.coolfields.co.uk/2016/05/text-for-screen-readers-only-updated/ +.screen-reader-text { + border: none; + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + margin: -1px; + width: 1px; + overflow: hidden; + position: absolute !important; + word-wrap: normal !important; +} diff --git a/config/initializers/date_select.rb b/config/initializers/date_select.rb index 8418f043a..ce68f165e 100644 --- a/config/initializers/date_select.rb +++ b/config/initializers/date_select.rb @@ -25,7 +25,7 @@ module ActionView end field_for = "#{prefix.join('_')}_#{@options[:field_name]}" - "" + "" end # Returns the separator for a given datetime component. diff --git a/spec/features/accessibilite/wcag_usager_spec.rb b/spec/features/accessibilite/wcag_usager_spec.rb index 4bd1e4fc2..c8ef9cee8 100644 --- a/spec/features/accessibilite/wcag_usager_spec.rb +++ b/spec/features/accessibilite/wcag_usager_spec.rb @@ -62,7 +62,7 @@ feature 'wcag rules for usager', js: true do fill_in('individual_nom', with: 'nom') click_on 'Continuer' - expect(page).to be_accessible.skipping :'aria-input-field-name', :label + expect(page).to be_accessible.skipping :'aria-input-field-name' end end @@ -93,7 +93,7 @@ feature 'wcag rules for usager', js: true do scenario 'dossier' do visit dossier_path(dossier) - expect(page).to be_accessible.skipping :label, :'aria-input-field-name' + expect(page).to be_accessible.skipping :'aria-input-field-name' end scenario 'merci' do @@ -113,12 +113,12 @@ feature 'wcag rules for usager', js: true do scenario 'modifier' do visit modifier_dossier_path(dossier) - expect(page).to be_accessible.skipping :'aria-input-field-name', :label + expect(page).to be_accessible.skipping :'aria-input-field-name' end scenario 'brouillon' do visit brouillon_dossier_path(dossier) - expect(page).to be_accessible.skipping :'aria-input-field-name', :label + expect(page).to be_accessible.skipping :'aria-input-field-name' end end end