fire event juuuuust before the component is mounted
This commit is contained in:
parent
def1362bb4
commit
732faa9264
1 changed files with 9 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue