From 75506ccfc01ec3cadfc0ae0f2e8784dc99d94aa4 Mon Sep 17 00:00:00 2001 From: Kiran Varma Date: Tue, 19 Nov 2024 17:22:22 +0000 Subject: [PATCH] add aria to textarea --- src/word-count/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/word-count/index.jsx b/src/word-count/index.jsx index e1d5cdf..7c84d76 100644 --- a/src/word-count/index.jsx +++ b/src/word-count/index.jsx @@ -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({ @@ -67,6 +67,7 @@ export default function WordCount(props) { {...props} value={content} onChange={e => handleChange(e.target.value)} + aria-describedby={name} /> {wordCountHintMessage(wordCount)}