Skip to content

Commit 4930a5a

Browse files
committed
Merge branch 'yeion7-sandbox-navigation-a11y'
2 parents c03ad36 + 0a4c3ab commit 4930a5a

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

packages/app/src/app/pages/Sandbox/Editor/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const Header: React.FC<IHeaderProps> = ({ zenMode }) => {
4444
} = useOvermind();
4545

4646
return (
47-
<Container zenMode={zenMode}>
47+
<Container zenMode={zenMode} as="header">
4848
<Left>
4949
{hasLogIn ? (
5050
<DashboardLink to={dashboardUrl()}>

packages/app/src/app/pages/Sandbox/Editor/Header/SandboxName/SandboxName.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const SandboxName: FunctionComponent = () => {
105105
) : (
106106
'Anonymous '
107107
)}
108-
/{' '}
108+
<span role="presentation">/ </span>
109109
</Folder>
110110
</animated.div>
111111
)}
@@ -124,10 +124,18 @@ export const SandboxName: FunctionComponent = () => {
124124
onKeyUp={handleKeyUp}
125125
placeholder={name}
126126
value={value}
127+
arial-label="sandbox name"
127128
/>
128129
</Form>
129130
) : (
130-
<Name onClick={owned ? handleNameClick : noop} owned={owned}>
131+
<Name
132+
as={owned ? 'button' : 'span'}
133+
onClick={owned ? handleNameClick : noop}
134+
owned={owned}
135+
aria-label={
136+
owned ? `${sandboxName}, change sandbox name` : sandboxName
137+
}
138+
>
131139
{sandboxName}
132140
</Name>
133141
)}

packages/app/src/app/pages/Sandbox/Editor/Header/SandboxName/elements.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export const Name = styled.span<{ owned?: boolean }>`
6464
margin-left: 0.25rem;
6565
cursor: ${owned ? 'pointer' : 'initial'};
6666
text-overflow: ellipsis;
67+
appearance: ${owned ? 'none' : 'initial'};
68+
background: none;
69+
border: 0;
70+
outline: 0;
6771
`}
6872
`;
6973

packages/app/src/app/pages/Sandbox/Editor/Navigation/Navigation.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const IconComponent: FunctionComponent<IconProps> = ({
7070
<IconContainer
7171
isDisabled={isDisabled}
7272
selected={selected}
73+
as="button"
74+
aria-label={name}
7375
onClick={() => {
7476
if (selected) {
7577
setWorkspaceHidden({ hidden: true });
@@ -79,7 +81,7 @@ const IconComponent: FunctionComponent<IconProps> = ({
7981
}
8082
}}
8183
>
82-
<Icon />
84+
<Icon aria-hidden />
8385
</IconContainer>
8486
</Tooltip>
8587
);
@@ -99,7 +101,12 @@ export const Navigation: FunctionComponent<Props> = ({
99101
const disabledItems = getDisabledItems(state);
100102

101103
return (
102-
<Container topOffset={topOffset} bottomOffset={bottomOffset}>
104+
<Container
105+
topOffset={topOffset}
106+
bottomOffset={bottomOffset}
107+
as="nav"
108+
aria-label="Sandbox Navigation"
109+
>
103110
<SingletonTooltip placement="right">
104111
{singleton => (
105112
<>

packages/app/src/app/pages/Sandbox/Editor/Navigation/elements.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export const IconContainer = styled.div<{
4343
props.theme[`activityBar.inactiveForeground`] ||
4444
css`rgba(255, 255, 255, 0.5)`};
4545
cursor: pointer;
46+
background: transparent;
47+
border: 0;
48+
appearance: none;
49+
outline: 0;
4650
4751
&:hover {
4852
color: ${props => props.theme[`activityBar.foreground`] || css`white`};

0 commit comments

Comments
 (0)