From 497c0576826826f9ea6b16fdd9e9b15fe891032a Mon Sep 17 00:00:00 2001 From: Devon A Thomson Date: Mon, 25 Oct 2021 18:00:58 -0400 Subject: [PATCH] communicate default index pattern when editor loaded --- .../control_types/options_list/options_list_editor.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx b/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx index dd446f57a94b9..493d7c314238c 100644 --- a/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx +++ b/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx @@ -55,7 +55,10 @@ export const OptionsListEditor = ({ const dataViewListItems = await getIdsWithTitle(); const initialId = initialInput?.dataViewId ?? (await getDefaultId()); let dataView: DataView | undefined; - if (initialId) dataView = await get(initialId); + if (initialId) { + onChange({ dataViewId: initialId }); + dataView = await get(initialId); + } if (!mounted) return; setState((s) => ({ ...s, dataView, dataViewListItems })); })();