Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Improve aria labels (#92)
Browse files Browse the repository at this point in the history
PBI: 29061 
Task: 31411
* Improve aria labels

* remove double button
  • Loading branch information
LukeSlev authored Aug 3, 2019
1 parent da6b882 commit 9029711
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/view/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const Button: React.FC<IButtonProps> = props => {
<button
id={`${props.label}-button`}
className={`${props.label}-button button`}
aria-label={props.label}
role="button"
onClick={props.onClick}
style={buttonStyle}
>
Expand Down
12 changes: 4 additions & 8 deletions src/view/components/cpx/Cpx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ const setupButtons = (props: IProps): void => {
const addButtonLabels = (button: HTMLElement) => {
let label = "";
if (button.id.match(/AB/) !== null) {
label = "A+B";
label = "a+b";
} else if (button.id.match(/A/) !== null) {
label = "A";
label = "a";
} else if (button.id.match(/B/) !== null) {
label = "B";
label = "b";
}
accessibility.setAria(button, "button", label);
};
Expand Down Expand Up @@ -319,11 +319,7 @@ const setupSwitch = (props: IProps): void => {
svgSwitch.onkeyup = e => props.onKeyEvent(e, false);

accessibility.makeFocusable(svgSwitch);
accessibility.setAria(
svgSwitch,
"button",
"On/Off Switch. Current state : " + props.switch ? "On" : "Off"
);
accessibility.setAria(svgSwitch, "button", "On/Off Switch");
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/view/components/toolbar/ToolBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ToolBar extends React.Component {
width={TOOLBAR_BUTTON_WIDTH}
onClick={() => {}}
image={TOOLBAR_SVG.NEO_PIXEL_SVG}
label="neo_pixel"
label="neopixel"
/>
<Button
width={TOOLBAR_BUTTON_WIDTH}
Expand Down

0 comments on commit 9029711

Please sign in to comment.