-
Notifications
You must be signed in to change notification settings - Fork 843
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
Aligning switch semantics with aria role #2193
Conversation
@@ -71,6 +71,11 @@ body { | |||
|
|||
*:focus { | |||
outline: none; | |||
|
|||
// sass-lint:disable no-vendor-prefixes | |||
&::-moz-focus-inner { |
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.
Firefox doesn't use outline
for focus states; this removes the border firefox gives all focused elements
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.
CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
|
|||
- Added `partial` glyph to `EuiIcon` ([#2152](https://github.com/elastic/eui/pull/2152)) | |||
|
|||
**Bug fixes** |
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.
You'll need to move your entries to the master
section at the top on the file.
(We're working on automating this somehow so it's not an annoyance in the future)
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.
Not sure I did correct still...
@thompsongl Hmmm, it seems pretty smooth on my machine... |
@myasonik I think you might have forgotten to push your latest changes? |
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 style & SASS changes LGTM, but if we remove onChange
for onToggle
and cause this to be a breaking change, there's still work to do.
Is there a specific reason (I didn't find any comment about that) why |
@timroes It was a bit talked about here. Basically:
I don't think anyone held any strong feelings on this though. So, if you think keeping the same method name is better, I can revert the name change. Would you shim the event all the time then? Or not do it at all? |
Good question, I am also not strongly against renaming it, just wondering if we shouldn't then do a similar renaming for the other controls as well, so they are not using onChange (unless they are really input fields)? So if we would keep |
@chandlerprall got any strong feelings? I'm leaning towards leaving it how I currently have it (deprecated Not sure what to do about other components though. Nothing right now but, in the future... 🤷♂ |
It definitely is nice to keep the form controls' API the same and expose Which brings up another point - the shimming of a This PR updates
We would need to typedef the shim with
|
Alright, we discussed this in the design meeting and we're all leaning toward maintaining the better developer experience, which is keeping this as This assumes:
|
a91e72e
to
bea6675
Compare
OK, I've removed the breaking change and have left the shimed I also changed the documentation to not actually use that property anymore though, instead relying on locally toggling the state, to quietly discourage its use. (Most implementations of swtich seem to do this anyway.) |
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.
Styling lgtm
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 still seeing the choppy animation in Firefox, but if no one else can reproduce, then everything looks good.
This reverts commit 76e58de.
* Removes FF's focus ring to match other browsers * Aligning switch semantics with aria role
* Revert "Convert `EuiSwitch` to TS (elastic#2243)" This reverts commit 39dbcf6. * Revert "Aligning switch semantics with aria role (elastic#2193)" This reverts commit 76e58de. * CL
Summary
Kibana was seeing issues with switches. Though we weren't able to figure out the root cause of the issue, switches have a unique aria role that they weren't taking advantage of. So, instead of continuing to dig, I thought I'd update the semantics skirting the issue a bit.
Following Inclusive Component's recommendation I've moved switches away from
<input type=checkbox />
to<button role=switch aria-checked=true|false>
.Checklist
- [ ] Props have proper autodocs- [ ] Added documentation examples