Add aria-describedby associations
This commit is contained in:
parent
cafac39733
commit
58e505cd38
1 changed files with 6 additions and 1 deletions
|
@ -122,6 +122,7 @@ export const InputField = forwardRef<
|
||||||
type={type}
|
type={type}
|
||||||
checked={checked}
|
checked={checked}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
aria-describedby={description ? id + "-desc" : undefined}
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -135,7 +136,11 @@ export const InputField = forwardRef<
|
||||||
{label}
|
{label}
|
||||||
</label>
|
</label>
|
||||||
{suffix && <span>{suffix}</span>}
|
{suffix && <span>{suffix}</span>}
|
||||||
{description && <p className={styles.description}>{description}</p>}
|
{description && (
|
||||||
|
<p id={id + "-desc"} className={styles.description}>
|
||||||
|
{description}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue