fire event juuuuust before the component is mounted

This commit is contained in:
jrkb 2023-05-04 17:17:47 +02:00
parent def1362bb4
commit 732faa9264

View file

@ -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 (
<Container
data-testid="DetailPanel-Object"