Make EuiBasicTable rows keyboard-accessible when they are clickable.#1206
Conversation
chandlerprall
left a comment
There was a problem hiding this comment.
Nice, so clean! LGTM, code review only.
|
|
||
| .euiTableRow-isClickable { | ||
| &:focus { | ||
| outline: solid 3px transparentize($euiColorPrimary, .9); |
There was a problem hiding this comment.
Is there a specific reason why an outline was added? The background color is already changing and the outline (which goes outside of the row borders) makes the coloring look a bit messy. I'd stick to one or the other.
There was a problem hiding this comment.
Nope I didn't even think about it -- just copied what we had from somewhere else! Which one do you think we should go with?
There was a problem hiding this comment.
I played around with it some and because of the row borders, the focus ring doesn't look so good, but I would like to adjust the hover color for clickable rows as well, so the best I came up with was:
.euiTableRow-isClickable {
&:hover {
background-color: transparentize($euiColorPrimary, .95);
}
&:focus {
background-color: transparentize($euiColorPrimary, .9);
}
}
There was a problem hiding this comment.
Nice! I like what you did there. This gibes with @chandlerprall's comment too. Will update.
|
IMO the hover state shouldn't override, as you can still Enter or Space to trigger the keyboard-selected row. |
|
Thanks for the reviews @chandlerprall @snide @cchaos! Updated with your feedback. |
| // Colors | ||
|
|
||
| $euiTableHoverClickableColor: transparentize($euiColorPrimary, .95); | ||
| $euiTableFocusClickableColor: transparentize($euiColorPrimary, .9) |
There was a problem hiding this comment.
Missing semicolon;
Sorry, being picky here, but can you move these to the bottom of the list since they are more specific modifiers?
Summary
When a row has an
onClickapplied to it, the row becomes keyboard-accessible (you can tab to it) and has a visual focus state.Checklist