-
Notifications
You must be signed in to change notification settings - Fork 842
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
Deprecating EuiToggle and EuiToggleButton #3099
Conversation
This comment has been minimized.
This comment has been minimized.
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 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.
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'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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
🤔 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I got it just from removing the aria-label
s 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
EuiToggle
andEuiToggleButton
closing #3023EuiToggle
andEuiToggleButton
weren't very accessible. To improve accessibility of EUI, we should deprecate them and migrate to instead usingaria-pressed
onEuiButton
andEuiButtonIcon
as appropriate.Breaking changes
EuiButtonGroup
now requireslegend
(previously optional) andtype
(previously defaulted to 'single' but not having a default lets us have way better types)name
prop fromEuiButtonGroupProps
which was unusedEuiButtonGroupOptionProps
withEuiButtonMultiGroupOptionProps
andEuiButtonSingleGroupOptionProps
(and moved some prop requirements from code to types)EuiButtonIcon
aria-label
/aria-lablledby
prop requirements from code to typesChecklist