diff --git a/src/components/Selectors/RadioButton/RadioButton.tsx b/src/components/Selectors/RadioButton/RadioButton.tsx index c3b59952c..98aa28044 100644 --- a/src/components/Selectors/RadioButton/RadioButton.tsx +++ b/src/components/Selectors/RadioButton/RadioButton.tsx @@ -44,7 +44,7 @@ export const RadioButton: FC = ({ value={value} onClick={(e) => { updateActiveRadioButton(value); - onRadioButtonClick(value, e); + onRadioButtonClick?.(value, e); }} readOnly /> diff --git a/src/components/Selectors/Selectors.types.ts b/src/components/Selectors/Selectors.types.ts index bfc6f79d4..e1b6ece17 100644 --- a/src/components/Selectors/Selectors.types.ts +++ b/src/components/Selectors/Selectors.types.ts @@ -1,4 +1,5 @@ import React from 'react'; +import { OcBaseProps } from '../OcBase'; export type SelectRadioButtonEvent = | React.MouseEvent @@ -22,7 +23,7 @@ export interface IRadioButtonsContext { onRadioButtonClick: OnChangeHandler; } -export interface CheckBoxProps { +export interface CheckBoxProps extends OcBaseProps { /** * Allows focus on the checkbox when it's disabled. */ @@ -70,7 +71,8 @@ export interface CheckBoxProps { onChange?: React.ChangeEventHandler; } -export interface RadioButtonProps { +export interface RadioButtonProps + extends Omit, 'onChange'> { /** * The default radio button to select */