Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/checkbox/checkbox.template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export const CheckboxTemplate: FunctionalComponent<CheckboxTemplateProps> = (
return [
<limel-dynamic-label
value={props.checked}
aria-controls={props.helperTextId}
aria-controls={
props.helperText ? props.helperTextId : undefined
}
defaultLabel={{ text: props.label, icon: icon }}
labels={props.readonlyLabels}
/>,
Expand Down Expand Up @@ -75,7 +77,9 @@ export const CheckboxTemplate: FunctionalComponent<CheckboxTemplateProps> = (
disabled={props.disabled || props.readonly}
required={props.required}
onChange={props.onChange}
aria-controls={props.helperTextId}
aria-controls={
props.helperText ? props.helperTextId : undefined
}
aria-describedby={props.helperTextId}
{...inputProps}
/>
Expand Down
5 changes: 4 additions & 1 deletion src/components/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ export class Slider {
value={this.multiplyByFactor(this.value)}
name="volume"
aria-labelledby={this.labelId}
aria-controls={this.helperTextId}
aria-describedby={
this.helperText ? this.helperTextId : undefined
}
aria-controls={this.helperText ? this.helperTextId : undefined}
{...inputProps}
/>
);
Expand Down
6 changes: 4 additions & 2 deletions src/components/switch/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ export class Switch {
return [
<limel-dynamic-label
value={this.value}
aria-controls={this.helperTextId}
aria-controls={
this.helperText ? this.helperTextId : undefined
}
defaultLabel={{ text: this.label, icon: icon }}
labels={this.readonlyLabels}
/>,
Expand All @@ -166,7 +168,7 @@ export class Switch {
aria-checked={this.value}
disabled={this.disabled}
onClick={this.handleClick}
aria-controls={this.helperTextId}
aria-controls={this.helperText ? this.helperTextId : undefined}
>
<div class="mdc-switch__track" />
<div class="mdc-switch__handle-track">
Expand Down
6 changes: 4 additions & 2 deletions src/components/text-editor/text-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ export class TextEditor implements FormComponent<string> {
<limel-markdown
slot="content"
value={this.value}
aria-controls={this.helperTextId}
aria-controls={
this.helperText ? this.helperTextId : undefined
}
id={this.editorId}
/>
);
Expand All @@ -284,7 +286,7 @@ export class TextEditor implements FormComponent<string> {
onMetadataChange={this.handleMetadataChange}
customElements={this.customElements}
value={this.value}
aria-controls={this.helperTextId}
aria-controls={this.helperText ? this.helperTextId : undefined}
id={this.editorId}
aria-disabled={this.disabled}
aria-invalid={this.invalid}
Expand Down