Skip to content

Commit

Permalink
add aria to textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
kiran-varma-home-office committed Nov 19, 2024
1 parent bf1b4ee commit 75506cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/word-count/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames';

export default function WordCount(props) {

const { value, maxWordCount, error, values } = props;
const { value, maxWordCount, error, values, name } = props;
const getWordCount = text => text?.split(/\s+/).filter(Boolean).length;

const [{ content, wordCount }, setContent] = useState({
Expand Down Expand Up @@ -67,6 +67,7 @@ export default function WordCount(props) {
{...props}
value={content}
onChange={e => handleChange(e.target.value)}
aria-describedby={name}
/>
{wordCountHintMessage(wordCount)}
</div>
Expand Down

0 comments on commit 75506cc

Please sign in to comment.