Fix dropdown for language selector as a template for other dropdowns #4204
+37
−43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
The problem with this implementation is that we cannot use icons in the dropdown, the reason why is that we use the
data-open-label
anddata-close-label
to set the dropdown text, but we can only insert text as values.We use now buttons to trigger the dropdown, making it more flexible to add text to button with icons.
We need to make sure that the accessibility attributes and values are also set.
This PR is a first approach to use both the Manon style and also the use of buttons including WCAG compatibility.
according to: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
I have used some of these attributes to comply with WCAG. This PR shows a change of only 1 dropdown, a way to use this to all other drop downs across KAT
Demo
QA notes
Make sure that the new CSS and JS is build:
cd rocky
nvm use 18
(you must have nodejs 18+ installed)yarn
(install yarn)yarn dev
(activate yarn)Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.