From 73ebb1737fb4044e340e35ada565fa323f47d89f Mon Sep 17 00:00:00 2001 From: Claire Dagan Date: Fri, 22 Sep 2023 15:11:12 +0200 Subject: [PATCH] fix(fields): prevent onChange event on readOnly mode --- src/fields/MultiRadio.tsx | 2 +- stories/fields/MultiRadio.stories.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fields/MultiRadio.tsx b/src/fields/MultiRadio.tsx index 897f241d5..daabddadb 100644 --- a/src/fields/MultiRadio.tsx +++ b/src/fields/MultiRadio.tsx @@ -65,7 +65,7 @@ export function MultiRadio({ [onChange] ) - useFieldUndefineEffect(isUndefinedWhenDisabled && disabled, onChange) + useFieldUndefineEffect(isUndefinedWhenDisabled && disabled && !isReadOnly, onChange) return (
= { title: 'Fields/MultiRadio', component: MultiRadio, @@ -43,6 +44,7 @@ export default { }) ] } +export default meta export function _MultiRadio(props: MultiRadioProps) { const [outputValue, setOutputValue] = useState('∅')