From 732faa926478cb10bcb4604f2fef9e5ed54be878 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Thu, 4 May 2023 17:17:47 +0200 Subject: [PATCH] fire event juuuuust before the component is mounted --- theatre/studio/src/panels/DetailPanel/DetailPanel.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/theatre/studio/src/panels/DetailPanel/DetailPanel.tsx b/theatre/studio/src/panels/DetailPanel/DetailPanel.tsx index 6f2979a..6953281 100644 --- a/theatre/studio/src/panels/DetailPanel/DetailPanel.tsx +++ b/theatre/studio/src/panels/DetailPanel/DetailPanel.tsx @@ -125,6 +125,15 @@ const DetailPanel: React.FC<{}> = (props) => { const obj = selection.find(isSheetObject) if (obj) { + const event = new CustomEvent('panelEvent', { + bubbles: false, + detail: { + panelID: obj.address.objectKey, + action: 'opened', + }, + }) + window.dispatchEvent(event) + return (