Hey,
I’m trying to set custom attributes (i.e., in this case, the id) to the groups/entries in my custom palette, which is required for other libraries to work properly.
While setting the attributes class and title works similarly to the example, id cannot be set.
Setting the following in CustomPaletteProvider:
return {
'create.low-task': {
// setting id will not work
id: 'entry1',
group: 'activity',
className: 'bpmn-icon-task red',
title: 'Create Task',
action: {
dragstart: createTask(SUITABILITY_SCORE_LOW),
click: createTask(SUITABILITY_SCORE_LOW)
}
}
...
}
… results in something like this:
<div class="entry bpmn-icon-task red" draggable="true" data-action="create.task" title="Create Task"></div>
However, the desired result is:
<div id="entry1" class="entry bpmn-icon-task red" draggable="true" data-action="create.task" title="Create Task"></div>
I found that setting attributes to groups/entries is limited to these attributes (cf. https://github.com/bpmn-io/diagram-js/blob/master/lib/features/palette/Palette.js#L219).
Is there a workaround to set the id to these elements?
E.g., something like an afterPaletteUpdateHook or overwriting the whole Palette's _update function?
Thank you very much for any help.