-
Notifications
You must be signed in to change notification settings - Fork 152
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
Select a11y enhancements #4543
Select a11y enhancements #4543
Conversation
Storybook staging is available at https://kiwicom-orbit-sarka-select-a11y.surge.sh |
Size Change: -107 B (-0.02%) Total Size: 460 kB
ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
8d86f8e
to
1f4fce7
Compare
7095271
to
2e3a324
Compare
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.
Key Issues
The ariaLabel
property should use Common.Translation
for consistency with other translatable properties to avoid internationalization issues. Ensure aria-label
is assigned a non-empty string to prevent accessibility problems, as the current approach lacks proper null checks.
8170156
to
ba97f36
Compare
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.
Key Issues
Casting label
to a string without checking for null or undefined can cause runtime errors and affect accessibility. The component's state management does not account for changes in the selectValue
prop, leading to potential stale state issues. Assuming a filter operation will always find a match can result in runtime errors if no match is found.
packages/orbit-components/src/InputGroup/InputGroup.stories.tsx
Outdated
Show resolved
Hide resolved
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.
Key Issues
The use of unsafe type assertions like label as string
can lead to runtime errors and accessibility issues, particularly affecting screen reader users if label
is undefined, null, or not a string.
0a631b4
to
8f828d5
Compare
210a022
to
b460268
Compare
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.
The commit message focuses on the implementation and not on the effect. The end user does not need to know that we use a cloneElement function internally, it's irrelevant for them. The fix
is actually that labels on InputField and Select elements inside an InputGroup were not being propagated and now they are (as aria-label)
@@ -269,7 +269,7 @@ const InputField = React.forwardRef<HTMLInputElement, Props>((props, ref) => { | |||
ref={ref} | |||
tabIndex={tabIndex !== undefined ? Number(tabIndex) : undefined} | |||
list={list} | |||
aria-labelledby={!label ? inputId : undefined} | |||
aria-label={label ? (label as string) : undefined} |
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.
This is not adding ariaLabel
prop. The component needs to accept the prop and add it, just like you did on Select.
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.
fixed. 🙈
0c4db6c
to
5c11a7b
Compare
This prop is was effectless. BREAKING CHANGE: This prop was effectless and now is no longer meant to be used.
BREAKING CHANGE: This prop was effectless and it is no longer available.
…to child components
5c11a7b
to
cfb5707
Compare
This Pull Request meets the following criteria:
For new components:
d.ts
files and are exported inindex.d.ts
Closes https://kiwicom.atlassian.net/browse/FEPLT-2176
✨
Description by Callstackai
This PR introduces accessibility enhancements to various components by adding
ariaLabel
props and updating related documentation.Diagrams of code changes
Files Changed
inputSize
prop fromProps
interface.inputSize
prop fromProps
interface.ariaLabel
prop to theInputField
component in the Playground story.ariaLabel
prop.ariaLabel
prop to theInputField
component.ariaLabel
prop toProps
interface.inputSize
prop fromInputFile
component.DateOfBirth
story to include labels for better accessibility.size
prop and updated how children are rendered.size
prop fromProps
interface.ariaLabel
prop.ariaLabel
prop to theSelect
component.ariaLabel
prop toProps
interface.This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.md
. See list of supported languages.