From b06871d329a7770f55321e4e71050b0ea2473cde Mon Sep 17 00:00:00 2001 From: jmfrancois Date: Tue, 10 Oct 2023 14:19:40 +0200 Subject: [PATCH] chore: fix build --- .../Form/Checkbox/Primitive/CheckboxPrimitive.tsx | 12 ++++-------- .../ToggleSwitch/Primitive/ToggleSwitchPrimitive.tsx | 4 +++- packages/design-system/src/components/Form/index.ts | 7 +++++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/design-system/src/components/Form/Checkbox/Primitive/CheckboxPrimitive.tsx b/packages/design-system/src/components/Form/Checkbox/Primitive/CheckboxPrimitive.tsx index d98d743a7d..de7cabfae8 100644 --- a/packages/design-system/src/components/Form/Checkbox/Primitive/CheckboxPrimitive.tsx +++ b/packages/design-system/src/components/Form/Checkbox/Primitive/CheckboxPrimitive.tsx @@ -16,10 +16,7 @@ import Label from '../../Label'; import styles from './Checkbox.module.scss'; -type CheckboxProps = Omit, 'onChange'> & { - // Redefine onChange - onChange?: (isChecked: boolean) => void; - +type CheckboxProps = InputHTMLAttributes & { value?: string | number; }; @@ -72,10 +69,9 @@ const CheckboxPrimitive = forwardRef( id={checkboxId} checked={checked} aria-checked={indeterminate ? 'mixed' : checked} - onChange={() => - // If readonly, we return current check status ; Else we return opposite status as new status - onChange?.(Boolean(readOnly ? checked : !checked)) - } + onChange={e => { + onChange?.(e); + }} {...rest} />