Deprecating EuiToggle and EuiToggleButton#3099
Deprecating EuiToggle and EuiToggleButton#3099myasonik wants to merge 17 commits intoelastic:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
cchaos
left a comment
There was a problem hiding this comment.
I'll come in with style commit for you but here are some of my initial thoughts.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7aa7ea5 to
65fef52
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
65fef52 to
918bebd
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cchaos
left a comment
There was a problem hiding this comment.
I'm working through the docs and styles but had some questions about some changes.
| export type HideOrLabel = ExclusiveUnion< | ||
| { 'aria-hidden': true }, | ||
| ExclusiveUnion<{ 'aria-label': string }, { 'aria-labelledby': string }> | ||
| >; |
There was a problem hiding this comment.
🤔 How are you getting that? When I run through the preview link it works as expected (reading "Next, button").
And the TS definition should* force a dev to pass in one of the three props which maintains the same functionality that this used to have (the console.warn would be suppressed if they passed in aria-hidden. If you're up for it, I'd happily cut the ability to pass in aria-hidden here because you're totally right that it's a terrible experience.
*: I say "should" here because I didn't test it thoroughly
There was a problem hiding this comment.
Btw, I got it just from removing the aria-labels from the examples. In this PR, the button now no longer complains about a non-exisiting aria-label. Which it should.
There was a problem hiding this comment.
OK, yeah, that was bad. I've tried again.
So aria-hidden is never allowed (we just should not be hiding a button or link from screen readers). And either aria-label or aria-labelled is required.
There was a problem hiding this comment.
🤦 Ignore that. EUI had a valid use case inside DataGrid for aria-hidden on a button. So I allow aria-hidden only with tabIndex=-1 and disallow trying to label it as well so people (hopefully) understand it won't work for screen readers or keyboard-only users.
src/components/date_picker/super_date_picker/quick_select_popover/quick_select.js
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3099/ |
|
@chandlerprall I force pushed latest because some datagrid tests are failing and props for EuiButtonGroup(Multi|Single)OptionProps won't render... 🤨 Maybe you could take a look? |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3099/ |
DataGrid errorsThe sort selector previously had the EuiButtonGroup*OptionPropsThey render for me. This is likely a cache issue where webpack is not made aware of the dependency on downstream type changes (blergh). Try changing the |
|
OK, I tested mobile, Light, Dark, Amsterdam Light, Amsterdam Dark, and ghost. I probably missed some permutations but I think it's ready for others to look at! |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3099/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_3099/ |
| 'euiButton--disabled': isGroupDisabled || isDisabled, | ||
| 'euiButtonGroup__toggle--iconOnly': isIconOnly, | ||
| 'euiButton--fill': fill, | ||
| 'euiButton--small': size === 'compressed' || size === 's', | ||
| 'euiButton--ghost': size !== 'compressed' && color === 'ghost', |
There was a problem hiding this comment.
This is a big anti-pattern I'd really like to avoid and what SASS mixins are for. It's going to take me a while, but I'll fix it.
|
Closed in favor of #4056 |


Summary
Deprecates
EuiToggleandEuiToggleButtonclosing #3023EuiToggleandEuiToggleButtonweren't very accessible. To improve accessibility of EUI, we should deprecate them and migrate to instead usingaria-pressedonEuiButtonandEuiButtonIconas appropriate.Breaking changes
EuiButtonGroupnow requireslegend(previously optional) andtype(previously defaulted to 'single' but not having a default lets us have way better types)nameprop fromEuiButtonGroupPropswhich was unusedEuiButtonGroupOptionPropswithEuiButtonMultiGroupOptionPropsandEuiButtonSingleGroupOptionProps(and moved some prop requirements from code to types)EuiButtonIconaria-label/aria-lablledbyprop requirements from code to typesChecklist