fix: multiselect crashing (#18577)
This commit is contained in:
parent
68bb871fa8
commit
058500704e
|
|
@ -700,6 +700,9 @@ class MultiSelectWidget extends BaseWidget<
|
||||||
|
|
||||||
// { label , value } is needed in the widget
|
// { label , value } is needed in the widget
|
||||||
mergeLabelAndValue = (): LabelInValueType[] => {
|
mergeLabelAndValue = (): LabelInValueType[] => {
|
||||||
|
if (!this.props.selectedOptionLabels || !this.props.selectedOptionValues) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
const labels = [...this.props.selectedOptionLabels];
|
const labels = [...this.props.selectedOptionLabels];
|
||||||
const values = [...this.props.selectedOptionValues];
|
const values = [...this.props.selectedOptionValues];
|
||||||
return values.map((value, index) => ({
|
return values.map((value, index) => ({
|
||||||
|
|
@ -747,8 +750,8 @@ export interface MultiSelectWidgetProps extends WidgetProps {
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
selectedOptions: LabelInValueType[];
|
selectedOptions: LabelInValueType[];
|
||||||
filterText: string;
|
filterText: string;
|
||||||
selectedOptionValues: string[];
|
selectedOptionValues?: string[];
|
||||||
selectedOptionLabels: string[];
|
selectedOptionLabels?: string[];
|
||||||
serverSideFiltering: boolean;
|
serverSideFiltering: boolean;
|
||||||
onFilterUpdate: string;
|
onFilterUpdate: string;
|
||||||
allowSelectAll?: boolean;
|
allowSelectAll?: boolean;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user