From 97f050bb39f5f88d80aab3aa7880002ead4f18d9 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 19 Aug 2022 21:24:35 +0200 Subject: fix(frontend): CodeMirror gutter accessibility Gutters are aria-hidden, so no accessibility attributes should point at them. --- subprojects/frontend/src/editor/EditorStore.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'subprojects/frontend/src/editor/EditorStore.ts') diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts index 2ed7f5ce..b634a427 100644 --- a/subprojects/frontend/src/editor/EditorStore.ts +++ b/subprojects/frontend/src/editor/EditorStore.ts @@ -121,15 +121,9 @@ export default class EditorStore { this.lintPanel.synchronizeStateToView(); // Reported by Lighthouse 8.3.0. - const { contentDOM, dom: containerDOM } = view; + const { contentDOM } = view; contentDOM.removeAttribute('aria-expanded'); contentDOM.setAttribute('aria-label', 'Code editor'); - const lineNumbersGutter = containerDOM.querySelector('.cm-lineNumbers'); - if (lineNumbersGutter === null) { - log.error('No line numbers in editor'); - } else { - lineNumbersGutter.id = this.lineNumbersId; - } log.info('Editor created'); } @@ -242,10 +236,6 @@ export default class EditorStore { log.debug('Redo', this.doStateCommand(redo)); } - get lineNumbersId(): string { - return `${this.id}-lineNumbers`; - } - toggleLineNumbers(): void { this.showLineNumbers = !this.showLineNumbers; log.debug('Show line numbers', this.showLineNumbers); -- cgit v1.2.3-54-g00ecf