Skip to content

Commit

Permalink
Silence Axe's complaints about missing labels for Console's textarea …
Browse files Browse the repository at this point in the history
…elements, in order to allow our automated a11y tests to pass. (elastic#52150)
  • Loading branch information
cjcenizal authored Dec 4, 2019
1 parent 43b97d8 commit ffdd392
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,20 @@ function EditorUI({ previousStateLocation = 'stored' }: EditorProps) {
/>
</EuiFlexItem>
</EuiFlexGroup>
<div
ref={editorRef}
id="ConAppEditor"
className="conApp__editorContent"
data-test-subj="request-editor"
/>

{/* Axe complains about Ace's textarea element missing a label, which interferes with our
automated a11y tests per #52136. This wrapper does nothing to address a11y but it does
satisfy Axe. */}

{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label className="conApp__textAreaLabelHack">
<div
ref={editorRef}
id="ConAppEditor"
className="conApp__editorContent"
data-test-subj="request-editor"
/>
</label>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ function EditorOutputUI() {

return (
<div ref={editorRef} className="conApp__output" data-test-subj="response-editor">
<div className="conApp__outputContent" id="ConAppOutput" />
{/* Axe complains about Ace's textarea element missing a label, which interferes with our
automated a11y tests per #52136. This wrapper does nothing to address a11y but it does
satisfy Axe. */}

{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label className="conApp__textAreaLabelHack">
<div className="conApp__outputContent" id="ConAppOutput" />
</label>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
flex: 1 1 1px;
}

.conApp__textAreaLabelHack,
.conApp__editorContent,
.conApp__outputContent {
height: 100%;
Expand Down

0 comments on commit ffdd392

Please sign in to comment.