Skip to content

Commit 967791d

Browse files
damienguezouGUEZOU Damiengarronej
authored
feat(ToggleSwitch): Add name attribute to ToggleSwitch (#112)
* feat(ToggleSwitch): Add name attribute to ToggleSwitch * Update src/ToggleSwitch.tsx Signed-off-by: Joseph Garrone <joseph.garrone.gj@gmail.com> --------- Signed-off-by: Joseph Garrone <joseph.garrone.gj@gmail.com> Co-authored-by: GUEZOU Damien <dguezou@jouve.fr> Co-authored-by: Joseph Garrone <joseph.garrone.gj@gmail.com>
1 parent 67462ba commit 967791d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ToggleSwitch.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export namespace ToggleSwitchProps {
3030
labelPosition?: "left" | "right";
3131
classes?: Partial<Record<"root" | "label" | "input" | "hint", string>>;
3232
style?: CSSProperties;
33+
name?: string;
3334
};
3435

3536
export type Uncontrolled = Common & {
@@ -64,6 +65,7 @@ export const ToggleSwitch = memo(
6465
onChange,
6566
inputTitle,
6667
style,
68+
name,
6769
...rest
6870
} = props;
6971

@@ -121,6 +123,7 @@ export const ToggleSwitch = memo(
121123
id={inputId}
122124
title={inputTitle}
123125
checked={props_checked ?? checked}
126+
name={name}
124127
/>
125128
<label
126129
className={cx(fr.cx("fr-toggle__label"), classes.label)}

0 commit comments

Comments
 (0)