Skip to content

Commit dd10f40

Browse files
committed
add hideLabel attribute, removed aria-labelledby
1 parent 710932f commit dd10f40

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Input.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type InputProps = {
1111
className?: string;
1212
label: ReactNode;
1313
hintText?: ReactNode;
14+
hideLabel?: boolean;
1415
/** default: false */
1516
disabled?: boolean;
1617
iconId?: FrIconClassName | RiIconClassName;
@@ -58,6 +59,7 @@ export const Input = memo(
5859
className,
5960
label,
6061
hintText,
62+
hideLabel,
6163
disabled = false,
6264
iconId: iconId_props,
6365
classes = {},
@@ -109,9 +111,8 @@ export const Input = memo(
109111
{...rest}
110112
>
111113
<label
112-
className={cx(fr.cx("fr-label"), classes.label)}
114+
className={cx(fr.cx("fr-label", hideLabel && "fr-sr-only"), classes.label)}
113115
htmlFor={inputId}
114-
aria-describedby="select-valid-desc-valid"
115116
>
116117
{label}
117118
{hintText !== undefined && <span className="fr-hint-text">{hintText}</span>}

0 commit comments

Comments
 (0)