From b40f490b79e5a921de8298f48491dccf633aac8c Mon Sep 17 00:00:00 2001 From: GUEZOU Damien Date: Tue, 18 Apr 2023 15:09:54 +0200 Subject: [PATCH 1/2] feat(ToggleSwitch): Add name attribute to ToggleSwitch --- src/ToggleSwitch.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ToggleSwitch.tsx b/src/ToggleSwitch.tsx index d3c73daa5..91a48cde3 100644 --- a/src/ToggleSwitch.tsx +++ b/src/ToggleSwitch.tsx @@ -30,6 +30,7 @@ export namespace ToggleSwitchProps { labelPosition?: "left" | "right"; classes?: Partial>; style?: CSSProperties; + name?: string; }; export type Uncontrolled = Common & { @@ -64,6 +65,7 @@ export const ToggleSwitch = memo( onChange, inputTitle, style, + name, ...rest } = props; @@ -121,6 +123,7 @@ export const ToggleSwitch = memo( id={inputId} title={inputTitle} checked={props_checked ?? checked} + {...(name !== undefined && { name: name })} />