fix: Some widgets don't seem to beusing meta state resulting in it not holding state in between edit and preview modes (#31970)
Fixes #31881 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Renamed `selectedOptionValue` to `selectedValues` in Checkbox and Switch Group Widgets to more accurately describe its functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
This commit is contained in:
parent
f60b65b919
commit
031aa63c99
|
|
@ -103,7 +103,7 @@ class WDSCheckboxGroupWidget extends BaseWidget<
|
|||
};
|
||||
|
||||
getWidgetView() {
|
||||
const { labelTooltip, options, selectedOptionValue, widgetId, ...rest } =
|
||||
const { labelTooltip, options, selectedValues, widgetId, ...rest } =
|
||||
this.props;
|
||||
|
||||
const validation = validateInput(this.props);
|
||||
|
|
@ -115,7 +115,7 @@ class WDSCheckboxGroupWidget extends BaseWidget<
|
|||
errorMessage={validation.errorMessage}
|
||||
onChange={this.onChange}
|
||||
validationState={validation.validationStatus}
|
||||
value={selectedOptionValue}
|
||||
value={selectedValues}
|
||||
>
|
||||
{options.map((option, index) => (
|
||||
<Checkbox key={`${widgetId}-option-${index}`} value={option.value}>
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class WDSSwitchGroupWidget extends BaseWidget<
|
|||
labelPosition,
|
||||
labelTooltip,
|
||||
options,
|
||||
selectedOptionValue,
|
||||
selectedValues,
|
||||
widgetId,
|
||||
...rest
|
||||
} = this.props;
|
||||
|
|
@ -122,7 +122,7 @@ class WDSSwitchGroupWidget extends BaseWidget<
|
|||
onChange={this.onChange}
|
||||
optionsLabelPosition={labelPosition}
|
||||
validationState={validation.validationStatus}
|
||||
value={selectedOptionValue}
|
||||
value={selectedValues}
|
||||
>
|
||||
{options.map((option, index) => (
|
||||
<Switch key={`${widgetId}-option-${index}`} value={option.value}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user