Deactivate directEditing when shape add


#1

Hello i’m trying to deactivate direct Editing when a shape is added, in my case is a task. I already use the event shape.added but i failed in disable the edit.


Deactivate Direct Editing when user appends a task
#2

This behavior is implemented in LabelEditingProvider. You can either override this component or intercept the event:


// make sure this is called after LabelEditingProvider
eventBus.on('create.end', 250, () => {
  directEditing.cancel();
}

#3

Hi, I’m sorry for replying only now, I tried that but did not work for me.
the event create.end active when i add a new shape using the ‘box’ (look the print)TASKADD
and still with this my js broke.

but when i add a new shape(task) using other shape like this: EVENT
the event create.end dont active.

Thank you for the attention.

EDIT: I wrote this in the console bpmnModeler.get(‘directEditing’).cancel(); and worked but i sitll dont know which event i should use and when.


#4
eventBus.on([
  'create.end',
  'autoPlace.end'
], 250, function() {
  directEditing.cancel();
});

This should work. When creating elements through clicking the context pad autoPlace.end is the event to listen for.


#5

Yes exactly what i need, thank you.
btw do you know if there’s any documentation of bpmn.io or only examples?


#6

We have a basic overview of how the toolkit works: https://bpmn.io/toolkit/bpmn-js/walkthrough/ Other than that unfortunately there’s no documentation, yet.