diff --git a/app/client/src/components/designSystems/blueprint/RadioGroupComponent.tsx b/app/client/src/components/designSystems/blueprint/RadioGroupComponent.tsx index 726349f3f9..5d7b7cd86d 100644 --- a/app/client/src/components/designSystems/blueprint/RadioGroupComponent.tsx +++ b/app/client/src/components/designSystems/blueprint/RadioGroupComponent.tsx @@ -44,7 +44,11 @@ class RadioGroupComponent extends React.Component { )} {this.props.options.map(option => { @@ -73,6 +77,7 @@ export interface RadioGroupComponentProps extends ComponentProps { onRadioSelectionChange: (updatedOptionValue: string) => void; selectedOptionValue: string; isLoading: boolean; + defaultOptionValue: string; } export default RadioGroupComponent; diff --git a/app/client/src/mockResponses/PropertyPaneConfigResponse.tsx b/app/client/src/mockResponses/PropertyPaneConfigResponse.tsx index 8900530f6e..534ed18323 100644 --- a/app/client/src/mockResponses/PropertyPaneConfigResponse.tsx +++ b/app/client/src/mockResponses/PropertyPaneConfigResponse.tsx @@ -567,7 +567,7 @@ const PropertyPaneConfigResponse = { id: "16.2", propertyName: "defaultOptionValue", label: "Default Selected Value", - controlType: "SWITCH", + controlType: "INPUT_TEXT", }, { id: "16.3", diff --git a/app/client/src/mockResponses/WidgetConfigResponse.tsx b/app/client/src/mockResponses/WidgetConfigResponse.tsx index d6222278a1..c6b56a628c 100644 --- a/app/client/src/mockResponses/WidgetConfigResponse.tsx +++ b/app/client/src/mockResponses/WidgetConfigResponse.tsx @@ -137,7 +137,7 @@ const WidgetConfigResponse: WidgetConfigReducerState = { { id: "2", label: "Bravo", value: "2" }, { id: "3", label: "Charlie", value: "3" }, ], - selectedOptionValue: "1", + defaultOptionValue: "1", widgetName: "RadioGroup", }, ALERT_WIDGET: { diff --git a/app/client/src/widgets/RadioGroupWidget.tsx b/app/client/src/widgets/RadioGroupWidget.tsx index 296cfa290c..b0157064fe 100644 --- a/app/client/src/widgets/RadioGroupWidget.tsx +++ b/app/client/src/widgets/RadioGroupWidget.tsx @@ -33,6 +33,7 @@ class RadioGroupWidget extends BaseWidget { onRadioSelectionChange={this.onRadioSelectionChange} key={this.props.widgetId} label={this.props.label} + defaultOptionValue={this.props.defaultOptionValue} selectedOptionValue={this.props.selectedOptionValue} options={this.props.options} isLoading={this.props.isLoading} @@ -41,7 +42,7 @@ class RadioGroupWidget extends BaseWidget { } onRadioSelectionChange = (updatedValue: string) => { - this.updateWidgetProperty("selectedOptionValue", updatedValue); + super.updateWidgetMetaProperty("selectedOptionValue", updatedValue); if (this.props.onSelectionChange) { super.executeAction({ dynamicString: this.props.onSelectionChange, @@ -68,6 +69,7 @@ export interface RadioGroupWidgetProps extends WidgetProps { options: RadioOption[]; selectedOptionValue: string; onSelectionChange: string; + defaultOptionValue: string; } export default RadioGroupWidget;