From e6d624437f292353b15d911cb8e6b53aaa3e65fa Mon Sep 17 00:00:00 2001 From: ClaudioGSDB Date: Thu, 16 Oct 2025 16:38:19 +0200 Subject: [PATCH] fix: Added aria descriptions to code-editors --- src/code-editor/index.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/code-editor/index.tsx b/src/code-editor/index.tsx index 5b01a54e6d..c486648c7c 100644 --- a/src/code-editor/index.tsx +++ b/src/code-editor/index.tsx @@ -79,6 +79,7 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref('hidden'); const [annotations, setAnnotations] = useState([]); @@ -135,6 +136,13 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref a.type === 'warning').length; const currentAnnotations = useMemo(() => annotations.filter(a => a.type === paneStatus), [annotations, paneStatus]); + const computedAriaDescription = useMemo(() => { + const errorText = `${errorCount} ${i18n('i18nStrings.errorsTab', i18nStrings?.errorsTab)}`; + const warningText = `${warningCount} ${i18n('i18nStrings.warningsTab', i18nStrings?.warningsTab)}`; + + return `${errorText}, ${warningText}`; + }, [errorCount, warningCount, i18n, i18nStrings]); + /* * Callbacks */ @@ -224,6 +232,7 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref +
{computedAriaDescription}