Aligning switch semantics with aria role#2193
Conversation
| outline: none; | ||
|
|
||
| // sass-lint:disable no-vendor-prefixes | ||
| &::-moz-focus-inner { |
There was a problem hiding this comment.
Firefox doesn't use outline for focus states; this removes the border firefox gives all focused elements
|
|
||
| - Added `partial` glyph to `EuiIcon` ([#2152](https://github.com/elastic/eui/pull/2152)) | ||
|
|
||
| **Bug fixes** |
There was a problem hiding this comment.
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.
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? |
cchaos
left a comment
There was a problem hiding this comment.
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.) |
thompsongl
left a comment
There was a problem hiding this comment.
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