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..defca366e2 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: { @@ -154,6 +154,7 @@ const WidgetConfigResponse: WidgetConfigReducerState = { files: [], columns: 4, widgetName: "FilePicker", + isDefaultClickDisabled: true, }, }, configVersion: 1, diff --git a/app/client/src/widgets/FilepickerWidget.tsx b/app/client/src/widgets/FilepickerWidget.tsx index c06b3dccfe..8d0292c1a4 100644 --- a/app/client/src/widgets/FilepickerWidget.tsx +++ b/app/client/src/widgets/FilepickerWidget.tsx @@ -12,6 +12,7 @@ import { VALIDATION_TYPES } from "constants/WidgetValidation"; import { EventType } from "constants/ActionConstants"; import { TriggerPropertiesMap } from "utils/WidgetFactory"; import Dashboard from "@uppy/dashboard"; +import shallowequal from "shallowequal"; class FilePickerWidget extends BaseWidget { uppy: any; @@ -124,7 +125,7 @@ class FilePickerWidget extends BaseWidget { componentDidUpdate(prevProps: FilePickerWidgetProps) { super.componentDidUpdate(prevProps); if ( - prevProps.allowedFileTypes !== this.props.allowedFileTypes || + !shallowequal(prevProps.allowedFileTypes, this.props.allowedFileTypes) || prevProps.maxNumFiles !== this.props.maxNumFiles ) { this.refreshUppy(this.props); 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;