Skip to content
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

[Infra UI] Change waffle map node to button for accessibility #31764

Merged
merged 2 commits into from
Feb 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions x-pack/plugins/infra/public/components/waffle/node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export class Node extends React.PureComponent<Props, State> {
<SquareOuter color={color}>
<SquareInner color={color}>
{valueMode ? (
<ValueInner>
<ValueInner aria-label={`${node.name}, click to open menu`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to translate the aria labels?

<Label color={color}>{node.name}</Label>
<Value color={color}>{value}</Value>
</ValueInner>
) : (
ellipsisMode && (
<ValueInner>
<ValueInner aria-label={`${node.name}, click to open menu`}>
<Label color={color}>...</Label>
</ValueInner>
)
Expand Down Expand Up @@ -126,7 +126,7 @@ const SquareInner = styled<ColorProps, 'div'>('div')`
background-color: ${props => props.color};
`;

const ValueInner = styled.div`
const ValueInner = styled.button`
position: absolute;
top: 0;
left: 0;
Expand All @@ -139,6 +139,13 @@ const ValueInner = styled.div`
padding: 1em;
overflow: hidden;
flex-wrap: wrap;
width: 100%;
border: none;
&:focus {
outline: none !important;
border: 3px solid ${params => params.theme.eui.euiFocusRingColor};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a euiFocusRingSize variable in the theme. Should we use it?

box-shadow: none;
}
`;

const Value = styled<ColorProps, 'div'>('div')`
Expand Down