When node has a tooltip shown, clicking node diagram does "jump"


Its hard to explaing so here is gif


If I will remove tooltip from node everything is working fine, diagram doesnt jump.

here is diagram config
diagram.isReadOnly = false;
diagram.allowSelect = true;
diagram.allowRelink = false;
diagram.allowCopy = false;
diagram.allowInsert = false;
diagram.allowClipboard = false;
diagram.allowLink = false;
diagram.allowDelete = false;
diagram.allowUndo = false;
diagram.allowMove = false;

Any ideas how tooltip can cause that and how to disable it?


So you haven’t set Diagram.contentAlignment?

How is the tooltip defined?

Actually diagram’s contentAlignment is set to go.Spot.TopCenter

Also I has differnet tooltips for different nodes, and both causing this side effect

			locationSpot: go.Spot.TopCenter,
			isShadowed: true,
			shadowOffset: new go.Point(0, 0),
		$(go.Placeholder, {
			padding: new go.Margin(10, 10, 7, 0),

Well, that setting of Diagram.contentAlignment probably explains it.

When the “ToolTip” is added to the Diagram, it is changing the Diagram.documentBounds, thus causing the diagram to be scrolled to keep the content (i.e. the document bounds) at the top-center of the viewport.

If you don’t want things in the “Tool” Layer to be included in the document bounds, you can set Layer.isInDocumentBounds to false. That should change the behavior that you reported, but might have undesirable side-effects with other Parts used by Tools. But probably not.

That Layer.isInDocumentBounds property is new and undocumented in v2.1, but will be documented in v2.2.

I found another interisting effect. If i set diagram.contentAlignment to to.Spot.Defatul, tooltip issue is gone. But diagram now is movabe even though its is set to allowMode = false;

Can you please give me an example, not sure I folow where I should Layer.isInDocumentBounds

myDiagram.findLayer("Tool").isInDocumentBounds = false;