DiagramWidget initializes its content in onAfterAttach. That Phosphor hook is called not only when the widget is created for the first time, but also when it is dragged to another panel (detached from the old panel and attached to the new panel). This leads to duplicate elements in the DOM.
DiagramWidget initializes its content in
onAfterAttach
. That Phosphor hook is called not only when the widget is created for the first time, but also when it is dragged to another panel (detached from the old panel and attached to the new panel). This leads to duplicate elements in the DOM.