Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add onChange event listener

dominik-zeglen0464a604b67d
diff --git a/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx b/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx
index 6b754d8b3a..b140f4a238 100644
--- a/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx
+++ b/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx
@@ -12,8 +12,15 @@ import * as React from "react";
export type CheckboxProps = Omit<
MuiCheckboxProps,
- "checkedIcon" | "color" | "icon" | "indeterminateIcon" | "classes"
->;
+ | "checkedIcon"
+ | "color"
+ | "icon"
+ | "indeterminateIcon"
+ | "classes"
+ | "onChange"
+> & {
+ onChange?: () => void;
+};
const styles = (theme: Theme) =>
createStyles({
@@ -103,7 +110,7 @@ const Checkbox = withStyles(styles, { name: "Checkbox" })(
name={name}
value={checked !== undefined && checked.toString()}
ref={inputRef}
- onChange={event => onChange(event, !inputRef.current.checked)}
+ onChange={onChange}
/>
</ButtonBase>
);