Closed plbabin closed 2 years ago
@phamburglar @tinkertrain It's possible to hide the focus state on when the CheckmarkCard is disabled. I did include it here because I wanted to show the tooltip by both mouse and keyboard.
The question is, what is more inline with a11y here: not focusable when disabled or not being able to show the tooltip when keyboard navigating to it 🤷. There is no perfect answer here I guess. The call we'll made will be the right one.
Long story short, anything's possible here 😄
@plbabin @tinkertrain Went down a mini rabbit hole and came across this link that explains how to make our scenario more accessible.
tldr; We should allow it to be focusable, even when disabled so that the user can see the tool tip. Essentially the "greyed" out opacity state will visually let them know it's disabled, but the focusable state will allow them to display the tooltip in line with what they're focused on. 👍
@phamburglar so are we good with the changes in this PR? I know you approved it but just want to make sure that everything's ok following the a11y discussion
@plbabin Good to go! ✅ -- My bad didn't realize you were waiting for me 🥴
@plbabin Good to go! ✅ -- My bad didn't realize you were waiting for me 🥴
@phamburglar no worries, waiting is a big word. more like the PR was in the background because I kinda forgot about it 😂
Problem/Feature
To support the work in an upcoming project, we had to implement some changes to the disabled state of the CheckmarkCard:
Update the UI
We removed all shadows and set a grey background (
grey.200
). Avatar is faded out and the heading/subtitle color are slightly lighterAdd tooltip support to the whole card
By passing a cardTooltipText prop to the CheckmarkCard, a tooltip will appear on focus/mouseover. The tooltip will still work when the card is disabled
Focus ring
we migrate the component to use the
focusRing
mixin for both the card and mark component. It simplifies the code but nothing should have change visually