diff --git a/app/components/dossiers/batch_select_more_component/batch_select_more_component.html.haml b/app/components/dossiers/batch_select_more_component/batch_select_more_component.html.haml index 5b049f3b1..69f772299 100644 --- a/app/components/dossiers/batch_select_more_component/batch_select_more_component.html.haml +++ b/app/components/dossiers/batch_select_more_component/batch_select_more_component.html.haml @@ -3,13 +3,13 @@ #not_selected %p{ role: "status" } = t('.pagination_files_selected_html') - %button.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline{ data: not_selected_button_data } + %button#js_select_more.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline{ data: not_selected_button_data } = not_selected_text #selected.hidden %p{ role: "status" } = selected_text - %button.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline{ data: selected_button_data } + %button#js_delete_selection.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline{ data: selected_button_data } = t(".delete_selection") = hidden_field_tag :"batch_operation[dossier_ids][]", "", form: dom_id(BatchOperation.new), id: dom_id(BatchOperation.new, "input_multiple_ids") diff --git a/app/javascript/controllers/batch_operation_controller.ts b/app/javascript/controllers/batch_operation_controller.ts index f4bc480b9..abc294b9c 100644 --- a/app/javascript/controllers/batch_operation_controller.ts +++ b/app/javascript/controllers/batch_operation_controller.ts @@ -24,6 +24,12 @@ export class BatchOperationController extends ApplicationController { if (pagination) { displayNotice(this.inputTargets); } + + // add focus on button for a11y + const button = document.getElementById('js_select_more'); + if (button) { + button.focus(); + } } onSelectMore(event: { @@ -44,6 +50,12 @@ export class BatchOperationController extends ApplicationController { hide(document.querySelector('#not_selected')); show(document.querySelector('#selected')); + + // add focus on button for a11y + const button = document.getElementById('js_delete_selection'); + if (button) { + button.focus(); + } } onDeleteSelection(event: { preventDefault: () => void }) {