Skip to content

Commit

Permalink
fix(TextArea): add aria-live and aria-placeholder (#6819)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
dakahn and kodiakhq[bot] authored Sep 23, 2020
1 parent 9743681 commit c239c1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/components/TextArea/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const TextArea = React.forwardRef(function TextArea(
invalidText,
helperText,
light,
placeholder,
...other
},
ref
Expand Down Expand Up @@ -66,7 +67,7 @@ const TextArea = React.forwardRef(function TextArea(
const errorId = id + '-error-msg';

const error = invalid ? (
<div className={`${prefix}--form-requirement`} id={errorId}>
<div role="alert" className={`${prefix}--form-requirement`} id={errorId}>
{invalidText}
</div>
) : null;
Expand All @@ -80,6 +81,8 @@ const TextArea = React.forwardRef(function TextArea(
<textarea
{...other}
{...textareaProps}
placeholder={placeholder}
aria-placeholder={placeholder} // for JAWS support
className={textareaClasses}
aria-invalid={invalid || null}
aria-describedby={invalid ? errorId : null}
Expand Down

0 comments on commit c239c1c

Please sign in to comment.