Skip to content

Commit

Permalink
Fixes elastic#28158 - Change waffle map node to button for accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Feb 22, 2019
1 parent f6770b1 commit 47ed251
Showing 1 changed file with 10 additions and 3 deletions.
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`}>
<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};
box-shadow: none;
}
`;

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

0 comments on commit 47ed251

Please sign in to comment.