Continuing the discussion from Some questions about some specific needs and whether bpmn-js can ensure them:
I tried following answer that Niklas_Kiefer kindly provided in the linked topic above(for global context).
You can have a look into this thread answer. It shows how to disable the direct editing for an element via double clicking (returning false). With this event handler, it would also be possible to add your custom logic, e.g. opening a modal.
So I implemented this event handler that is supposed to open an angular dialog(can be found in the codesandbox linked below in the ngOnInit lifecycle hook.
let eventBus = this.bpmnJS.get("eventBus");
eventBus.on("element.dblclick", 2000, function (context) {
console.log("selected");
this.openDialog();
});
But whenever the event is triggered I get the error :
TypeError: Cannot read property āopenDialogā of null
So, Iām guessing itās referring at the keyword āthisā being interpreted as null.
I reproduced my issue in this codesandbox.
I also added a button that opens the dialog, and double clicking on an element throws the said error.