Skip to content

Commit 8545a02

Browse files
committed
Add missing aria labels and expand state to various elements
1 parent 5df26a8 commit 8545a02

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

src/components/common/card.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ export class CollapsibleCard extends React.Component<
169169
direction={this.props.direction}
170170
headerAlignment={this.props.headerAlignment ?? 'right'}
171171

172+
aria-expanded={collapsable
173+
? !this.props.collapsed
174+
: undefined
175+
}
172176
tabIndex={collapsable ? 0 : undefined}
173177
ref={this.cardRef}
174178
onKeyDown={this.onKeyDown}

src/components/intercept/intercept-page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ class InterceptPage extends React.Component<InterceptPageProps> {
138138
search for connectors that could work for you:
139139
</p>
140140
<InterceptSearchBox
141+
aria-label="Filter the list of intercept options below"
141142
value={this.filter || ''}
142143
onSearch={this.onSearchInput}
143144
/>

src/components/mock/mock-rule-group.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ export const GroupHeader = observer((p: {
235235
>{ (provided, snapshot) => <Observer>{ () =>
236236
<GroupHeaderContainer
237237
depth={p.path.length - 1}
238+
aria-expanded={!p.collapsed}
238239
collapsed={p.collapsed}
239240
editingTitle={isEditing}
240241

@@ -246,7 +247,14 @@ export const GroupHeader = observer((p: {
246247
onKeyPress={clickOnEnter}
247248
tabIndex={0}
248249
>
249-
<DragHandle {...provided.dragHandleProps} />
250+
<DragHandle
251+
aria-label={`Drag handle for the '${
252+
isEditing
253+
? unsavedTitle
254+
: p.group.title
255+
}' rule group`}
256+
{...provided.dragHandleProps}
257+
/>
250258

251259
<h2>
252260
<Icon

src/components/mock/mock-rule-row.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const AddRuleRow = styled((p: {
127127
collapsed={true}
128128
borderColor='transparent'
129129
{..._.omit(p, 'onAdd')}
130+
role="button"
130131

131132
tabIndex={0}
132133
depth={0}
@@ -384,6 +385,7 @@ export class RuleRow extends React.Component<{
384385
provided.innerRef(ref);
385386
this.containerRef = ref;
386387
}}
388+
aria-expanded={!collapsed}
387389
collapsed={collapsed}
388390
deactivated={!rule.activated}
389391
disabled={disabled}
@@ -407,7 +409,14 @@ export class RuleRow extends React.Component<{
407409
isEditingTitle={isEditingTitle}
408410
onSetCustomTitle={this.startEnteringCustomTitle}
409411
/>
410-
<DragHandle {...provided.dragHandleProps} />
412+
<DragHandle
413+
aria-label={`Drag handle for ${
414+
(shouldShowCustomTitle || isEditingTitle) && rule.title
415+
? `this '${rule.title}'`
416+
: 'this'
417+
} mock rule`}
418+
{...provided.dragHandleProps}
419+
/>
411420

412421

413422
{ shouldShowCustomTitle &&

0 commit comments

Comments
 (0)