From 41330142f125b84e6c67b328b14efe8e1f9becde Mon Sep 17 00:00:00 2001 From: Maxime Da Silva Date: Thu, 13 Oct 2022 15:02:20 +0200 Subject: [PATCH] feat(radio-field): remove onChange default handler and make onChange optional on calls --- packages/react/lib/RadioField/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/lib/RadioField/index.js b/packages/react/lib/RadioField/index.js index ce7f819fc..a273901f1 100644 --- a/packages/react/lib/RadioField/index.js +++ b/packages/react/lib/RadioField/index.js @@ -16,7 +16,7 @@ const RadioField = forwardRef(({ parseValue = val => val?.value ?? val, parseTitle = val => val?.title ?? val?.toString?.(), parseDescription = val => val?.description || '', - onChange = () => {}, + onChange, onValidate = (val, { required }) => (val !== undefined && val !== null) || !required, ...rest @@ -60,7 +60,7 @@ const RadioField = forwardRef(({ dirty: true, }); - onChange({ + onChange?.({ value: parseValue(option), valid, });