Skip to content

Commit 229698f

Browse files
committed
fix(text-editor): ensure aria-controls references an existing element
1 parent dfff196 commit 229698f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/text-editor/text-editor.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ export class TextEditor implements FormComponent<string> {
267267
<limel-markdown
268268
slot="content"
269269
value={this.value}
270-
aria-controls={this.helperTextId}
270+
aria-controls={
271+
this.helperText ? this.helperTextId : undefined
272+
}
271273
id={this.editorId}
272274
/>
273275
);
@@ -284,7 +286,7 @@ export class TextEditor implements FormComponent<string> {
284286
onMetadataChange={this.handleMetadataChange}
285287
customElements={this.customElements}
286288
value={this.value}
287-
aria-controls={this.helperTextId}
289+
aria-controls={this.helperText ? this.helperTextId : undefined}
288290
id={this.editorId}
289291
aria-disabled={this.disabled}
290292
aria-invalid={this.invalid}

0 commit comments

Comments
 (0)