From 41ecea114866d42b13e6000089f95b295fe71c12 Mon Sep 17 00:00:00 2001 From: Leticia de la Osa Date: Thu, 25 Apr 2024 11:44:07 +0200 Subject: [PATCH] accessible dropdown component --- .../components/option-group.component.tsx | 29 +++-- .../components/dropdown/dropdown.business.ts | 48 +++++++++ .../dropdown/dropdown.component.module.css | 44 ++++---- .../dropdown/dropdown.component.tsx | 102 ++++++++++++++---- .../dropdown-formik.component.tsx | 1 + .../dropdown.component.module.css | 1 + .../icons/expand-down-icon.component.tsx | 3 +- .../modal-dialog/modal.dialog.bussines.ts | 8 +- .../edit-relation/edit-relation.component.tsx | 2 +- 9 files changed, 176 insertions(+), 62 deletions(-) create mode 100644 src/common/components/dropdown/dropdown.business.ts diff --git a/src/common/components/dropdown/components/option-group.component.tsx b/src/common/components/dropdown/components/option-group.component.tsx index 604745f3..decd11ba 100644 --- a/src/common/components/dropdown/components/option-group.component.tsx +++ b/src/common/components/dropdown/components/option-group.component.tsx @@ -10,6 +10,8 @@ interface Props { optionsListVisible: boolean; handleOptionClick: (option: DropdownOptionVm) => void; selectedOption?: string; + modalRef: React.RefObject; + label?: string; } export const OptionGroup: React.FC = props => { @@ -19,12 +21,19 @@ export const OptionGroup: React.FC = props => { optionsListVisible, handleOptionClick, selectedOption, + modalRef, + label, } = props; return (
    e.stopPropagation()} + id={`${name}-select`} + role="listbox" + aria-label={label} >