From 83da3f5176f574d78895663fce2a129b9bbae5b2 Mon Sep 17 00:00:00 2001 From: rshen91 Date: Tue, 1 Oct 2024 08:28:30 -0600 Subject: [PATCH] fix --- .../public/control_group/components/control_panel.tsx | 2 +- .../options_list_control/components/options_list_control.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/controls/public/control_group/components/control_panel.tsx b/src/plugins/controls/public/control_group/components/control_panel.tsx index 1641aacd10570..2fe177a46f8d3 100644 --- a/src/plugins/controls/public/control_group/components/control_panel.tsx +++ b/src/plugins/controls/public/control_group/components/control_panel.tsx @@ -189,7 +189,7 @@ export const ControlPanel = } - compressed={api?.parentApi.parentApi.compressed ?? true} + compressed={api?.parentApi?.parentApi?.compressed ?? true} > <> {blockingError && ( diff --git a/src/plugins/controls/public/controls/data_controls/options_list_control/components/options_list_control.tsx b/src/plugins/controls/public/controls/data_controls/options_list_control/components/options_list_control.tsx index c705213cf01e1..a383c1d5d9a53 100644 --- a/src/plugins/controls/public/controls/data_controls/options_list_control/components/options_list_control.tsx +++ b/src/plugins/controls/public/controls/data_controls/options_list_control/components/options_list_control.tsx @@ -67,8 +67,8 @@ export const OptionsListControl = ({ const delimiter = useMemo(() => OptionsListStrings.control.getSeparator(field?.type), [field]); const isCompressed = - api.parentApi.parentApi && api.parentApi.parentApi.compressed - ? api.parentApi.parentApi.compressed + api.parentApi?.parentApi && api.parentApi?.parentApi?.compressed + ? api.parentApi?.parentApi?.compressed : true; const { hasSelections, selectionDisplayNode, selectedOptionsCount } = useMemo(() => {