accessibility improvements

This commit is contained in:
Tao Bojlén 2020-04-21 20:31:29 +01:00
parent 5d8b8c6dbd
commit 51daf3efae
No known key found for this signature in database
GPG Key ID: C6EC7AAB905F9E6F
7 changed files with 17 additions and 6 deletions

View File

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bring back `develop` staging backup (now managed in DNS) - Bring back `develop` staging backup (now managed in DNS)
- Increase default number of concurrent crawlers to 100 - Increase default number of concurrent crawlers to 100
- Accessibility improvements (according to axe review)
### Deprecated ### Deprecated

View File

@ -13,7 +13,7 @@ interface IGraphHideEdgesButtonProps {
} }
const GraphHideEdgesButton: React.FC<IGraphHideEdgesButtonProps> = ({ isShowingEdges, toggleEdges }) => ( const GraphHideEdgesButton: React.FC<IGraphHideEdgesButtonProps> = ({ isShowingEdges, toggleEdges }) => (
<FloatingCard> <FloatingCard>
<StyledSwitch checked={isShowingEdges} label="Show connections" onChange={toggleEdges} /> <StyledSwitch checked={isShowingEdges} label="Show connections" onChange={toggleEdges} tabIndex={-1} />
</FloatingCard> </FloatingCard>
); );
export default GraphHideEdgesButton; export default GraphHideEdgesButton;

View File

@ -74,8 +74,15 @@ const GraphKey: React.FC<IGraphKeyProps> = ({ current, colorSchemes, ranges, onI
text={(current && current.name) || "Select..."} text={(current && current.name) || "Select..."}
icon={IconNames.TINT} icon={IconNames.TINT}
rightIcon={IconNames.CARET_DOWN} rightIcon={IconNames.CARET_DOWN}
tabIndex={-1}
/>
<Button
icon={IconNames.SMALL_CROSS}
minimal={true}
onClick={unsetColorScheme}
disabled={!current}
tabIndex={-1}
/> />
<Button icon={IconNames.SMALL_CROSS} minimal={true} onClick={unsetColorScheme} disabled={!current} />
</ColorSchemeSelect> </ColorSchemeSelect>
<br /> <br />
{!!current && !!key && ( {!!current && !!key && (

View File

@ -7,7 +7,7 @@ interface IGraphResetButtonProps {
} }
const GraphResetButton: React.FC<IGraphResetButtonProps> = ({ onClick }) => ( const GraphResetButton: React.FC<IGraphResetButtonProps> = ({ onClick }) => (
<FloatingCard> <FloatingCard>
<Button icon="compass" title="Reset graph view" onClick={onClick} /> <Button icon="compass" title="Reset graph view" onClick={onClick} tabIndex={-1} />
</FloatingCard> </FloatingCard>
); );
export default GraphResetButton; export default GraphResetButton;

View File

@ -76,7 +76,7 @@ class GraphImpl extends React.PureComponent<IGraphProps, IGraphState> {
); );
} }
return <GraphDiv>{content}</GraphDiv>; return <GraphDiv aria-hidden={true}>{content}</GraphDiv>;
} }
private loadGraph = () => { private loadGraph = () => {

View File

@ -250,7 +250,7 @@ class InstanceScreenImpl extends React.PureComponent<IInstanceScreenProps, IInst
return; return;
} }
return ( return (
<StyledGraphContainer> <StyledGraphContainer aria-hidden={true}>
<Cytoscape <Cytoscape
elements={localGraph!} elements={localGraph!}
currentNodeId={this.props.instanceName} currentNodeId={this.props.instanceName}

View File

@ -104,7 +104,9 @@ class SearchScreen extends React.PureComponent<ISearchScreenProps, ISearchScreen
if (isLoadingResults) { if (isLoadingResults) {
rightSearchBarElement = <Spinner size={Spinner.SIZE_SMALL} />; rightSearchBarElement = <Spinner size={Spinner.SIZE_SMALL} />;
} else if (query || error) { } else if (query || error) {
rightSearchBarElement = <Button minimal={true} icon={IconNames.CROSS} onClick={this.clearQuery} />; rightSearchBarElement = (
<Button minimal={true} icon={IconNames.CROSS} onClick={this.clearQuery} aria-label="Search" />
);
} else { } else {
rightSearchBarElement = ( rightSearchBarElement = (
<Button <Button
@ -127,6 +129,7 @@ class SearchScreen extends React.PureComponent<ISearchScreenProps, ISearchScreen
rightElement={rightSearchBarElement} rightElement={rightSearchBarElement}
large={true} large={true}
placeholder="Search instance names and descriptions" placeholder="Search instance names and descriptions"
aria-label="Search instance names and descriptions"
type="search" type="search"
value={this.state.currentQuery} value={this.state.currentQuery}
onChange={this.handleInputChange} onChange={this.handleInputChange}