-
Notifications
You must be signed in to change notification settings - Fork 4.7k
BorderControl: Update labelling, tooltips and wrap with fieldset and legend #42348
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
Conversation
| __next36pxDefaultSize={ __next36pxDefaultSize } | ||
| /> | ||
| <UnitControl | ||
| label={ __( 'Border width' ) } |
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 the labels for the inner UnitControl and RangeControl be labelled differently when they are both for controlling the same thing i.e. "Border width"?
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 think it's ok that they are the same, since the distinction is made by the screen reader when it says the role ("stepper" vs. "slider"). Though I'll defer to @afercia if there are better ways.
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'll look to merge these improvements later today but am happy to tweak the labels further in a follow-up if desired.
|
Size Change: +382 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
mirka
left a comment
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.
Thanks for addressing this so quickly! We need to tweak the padding thing, but otherwise the changes look good to me.
packages/components/src/border-control/border-control/component.tsx
Outdated
Show resolved
Hide resolved
| __next36pxDefaultSize={ __next36pxDefaultSize } | ||
| /> | ||
| <UnitControl | ||
| label={ __( 'Border width' ) } |
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 think it's ok that they are the same, since the distinction is made by the screen reader when it says the role ("stepper" vs. "slider"). Though I'll defer to @afercia if there are better ways.
mirka
left a comment
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.
Looks great 🚀
|
Missing changelog incoming via: #42411 |
Related:
What?
Updates the
BorderControlcomponent to improve labelling, DOM structure, and tooltips.Note: Improvements to the
BorderBoxControlwill be addressed in a separate PRWhy?
Accessibility is important.
How?
BorderControlwrapping element to afieldsetand its primary label to alegendUnitControlandRangeControlcomponentsgetByRoleandqueryByRolecalls in unit tests to also filter by nameTesting Instructions
npm run test-unit /packages/components/src/border-control/testBorderControlstill functions correctly