Open MisRob opened 2 weeks ago
hey @MisRob can i work on this issue?
Hi @lokesh-sagi125, you're welcome to take this on. Thanks for your continued contributions. Please follow guidance closely and you're welcome to ask questions here if there's anything that's not clear.
hey @MisRob you want the warning to be displayed in the console right?
Hi @lokesh-sagi125, yes
@MisRob can i work on this?
Hey @iamshobhraj! Thanks for your interest in contributing to this issue. Unfortunately, this is already assigned. But you’re welcome to find a "help wanted" issue with no assignee :hugs:.
hey @MisRob sorry for the inactivity i was busy with a hackathon ; i just opened a PR for this issue could you please review the changes :).
🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.
Summary
In https://github.com/learningequality/kolibri-design-system/pull/650, we introduced a new
KRadioButtonGroup
that ensuresKRadioButton
groups are accessible in all supported browsers. For this to properly work, allKRadioButton
s need to be nested insideKRadioButtonGroup
likebut it could also be more deeply nested structures such as
The goal of this issue is to add logic to
KRadioButton
that shows a warning for developers when it's not nested insideKRadioButtonGroup
.The Value Add
This will notify developers about the proper usage and ensures expected a11y behavior for users.
Possible Tradeoffs
A risk of possible performance issues since it adds logic to every
KRadioButton
that needs to traverse all its parents (see "Guidance" on how to possibly take care of this)Guidance
KRadioButton
documentation page with more examples of usageKRadioButton
is nested inKRadioButtonGroup
so we will need to look at its chain of parents untilKRadioButtonGroup
is found.KRadioButton
, we need to be careful to not use techniques of accessing the DOM that may cause performance issues.this.$parent
and checking each$parent
's$options._componentTag
until we find'KRadioButtonGroup'
component tag or until there is no more parents, could be the wayif (process.env.NODE_ENV !== 'production') {
. @rtibbles says "this will also tree shake the code out in webpack builds." ;)Acceptance criteria
KRadioButton
sComments
This update would ideally be released after https://github.com/learningequality/kolibri/issues/12596 so that we're not overwhelmed by warnings in Kolibri ;)