-
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
Make EuiBasicTable rows keyboard-accessible when they are clickable. #1206
Make EuiBasicTable rows keyboard-accessible when they are clickable. #1206
Conversation
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.
Nice, so clean! LGTM, code review only.
src/components/table/_table.scss
Outdated
|
||
.euiTableRow-isClickable { | ||
&:focus { | ||
outline: solid 3px transparentize($euiColorPrimary, .9); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I like what you did there. This gibes with @chandlerprall's comment too. Will update.
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.
Code looks good to me. Share @cchaos' comment on the styling, but other than that this is really nice!
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. |
src/components/table/_variables.scss
Outdated
@@ -9,6 +9,8 @@ $euiTableActionsAreaWidth: $euiSizeXXL; | |||
|
|||
// Colors | |||
|
|||
$euiTableHoverClickableColor: transparentize($euiColorPrimary, .95); | |||
$euiTableFocusClickableColor: transparentize($euiColorPrimary, .9) |
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.
Missing semicolon;
Sorry, being picky here, but can you move these to the bottom of the list since they are more specific modifiers?
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.
No prob, done.
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.
Thanks!
Summary
When a row has an
onClick
applied to it, the row becomes keyboard-accessible (you can tab to it) and has a visual focus state.Checklist