Skip to content

Commit

Permalink
Add aria-label={title} if no label provided (a11y)
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed Mar 5, 2024
1 parent 804b3eb commit dfc7fe8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/css-value-input/src/CSSValueInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ export default React.forwardRef<HTMLInputElement, Props>(function CSSValueInput(
);

return (
<label className={clsx(ROOT_CLASS_NAME, className, { disabled })} title={title}>
<label
aria-label={label ? undefined : title}
className={clsx(ROOT_CLASS_NAME, className, { disabled })}
title={title}
>
{icon ? <div className={`${ROOT_CLASS_NAME}-icon`}>{icon}</div> : null}
{label ? (
<div className={`${ROOT_CLASS_NAME}-label`}>
Expand Down

0 comments on commit dfc7fe8

Please sign in to comment.