-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the new ariaLabelledBy prop in KSwitch #12918
base: develop
Are you sure you want to change the base?
Using the new ariaLabelledBy prop in KSwitch #12918
Conversation
Thanks for yet another contribution @RONAK-AI647 :)! I will invite my colleagues @LianaHarris360 or @marcellamaki for review. One thing I noticed myself concerns translations of strings. Please have a look at how to write localized strings and try to follow the guide. |
Build Artifacts
|
Hi @RONAK-AI647 - thanks for your contribution! The main goal of using aria-labeledby is to associate text that is present on the page to another element. It's usually applied in specific scenarios where something is visually apparent, but semantically within the HTML, would not be properly associated with someone who is using a screen reader. What text in the UI are you trying to associate with each of these elements? How might you do that without adding additional spans and text? |
<KSwitch | ||
name="toggle-quiz-visibility" | ||
:aria-labelledby="'toggle-quiz-visibility'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this line match the id='toggle-quiz-visibility-label'
in the span above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, shouldn't the prop be named ariaLabelledBy
rather than :aria-labelledby
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some great thoughts have already been shared, I just had a couple more points to add. Thanks for your work on this @RONAK-AI647 !
v-else | ||
:key="`switch-${lesson.id}`" | ||
v-else: | ||
key="`switch-${lesson.id}`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this piece of code is causing an error in my code editor. Is there a particular reason that the :
colon was moved from in front of key
and positioned after v-else
?
name="toggle-lesson-visibility" | ||
:ariaLabelledBy="`toggle-lesson-visibility-label-${lesson.id}`" | ||
label="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is set as an empty string, is the label
property still required now that we have the ariaLabelledBy
prop in use?
<KSwitch | ||
name="toggle-quiz-visibility" | ||
:aria-labelledby="'toggle-quiz-visibility'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, shouldn't the prop be named ariaLabelledBy
rather than :aria-labelledby
?
Thank You everybody for reviewing @marcellamaki @LianaHarris360 @nucleogenesis @MisRob , give me some time , i will return with everything resolved .!!!!!! |
Summary
1)There are many uses of Kswitch in kolibri's codebase. learningequality/kolibri-design-system#806
introduced a new feature named arialLabelledBy in KDS , using that feature , some of the Kswitchs' doesnt have a label set.
3)All KSwitch components should have a label, either set by the ariaLabelledBy or by the label prop
References
#12743
Issue/learningequality/kolibri-design-system#806
…
Reviewer guidance
…