How to prevent creating link vertices on double clicking link labels? #2370
-
IntroductionWe are using Joint to create the following graph: We have registered a double click handler on the link label "Yes" and I have selected the link in the screen shot. Normally, if double click on the link label, an inline editor opens and I can edit the link. However, in the depicted situation, if I happen to double click in the lower right corner of the link label, a vertex is created on the link before the inline editor is opened: This happens because the link tools are drawn invisibly on top of the whole graph, thus creating the single click on every double click event on the graph. How can I avoid that double clicking on a link label which covers the actual link accidentally creates vertices? Steps to reproduceNo response Restrictions & Constraints
Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The only option now I can think of is to set the const paper = new dia.Paper({
/* ... */
labelsLayer: true
});
// Move the labels layer in front of the tools layer
// so the labels are not covered by the tools.
const labelsLayerEl = paper.getLayerNode(dia.Paper.Layers.LABELS);
labelsLayerEl.parentNode.appendChild(labelsLayerEl); Note: This will be more elegant once we introduce an official Layer API. |
Beta Was this translation helpful? Give feedback.
The only option now I can think of is to set the
labelsLayer
paper's option totrue
and move the label's layer<g/>
element after the tool's layer element.Note: This will be more elegant once we introduce an official Layer API.