I have a question , my page is divend into 2 section the first is the top is shown GoJS Diagram and the last is bottom is shown the description diagram (it’s same as your example such as State Chart) but when we scroll vertical bar of the browser to bottom a little bit in order to read description and when I click the node on diagram, the vertical scroll bar of the browser is moved up to the top automatically. Did you have any solution to fix this?
myDiagram.doFocus = function() {
// sometimes, maybe when a flag is set, disallow focus
if (/* some condition that you set */) return;
// otherwise do the default focus behavior:
go.Diagram.prototype.doFocus.call(this);
}
but I have one question, if I want to delete or edit the selected node how to apply this code? I have seen “doFocus” is called before “ObjectSingleClicked” or “ObjectDoubleClicked” that why I cannot mark any flag in the if condition.
myDiagram.doFocus = function() {
var x = window.scrollX || window.pageXOffset;
var y = window.scrollY || window.pageYOffset;
go.Diagram.prototype.doFocus.call(this);
window.scrollTo(x, y);
}
This will let it focus, but stop the scrolling. It seems to work on Chrome, Firefox, IE11, and iOS Safari
Thank you for your support, Actually I don’t know about “go.Diagram.prototype.doFocus” function too much but I just wonder about Synchronous function of the “go.Diagram.prototype.doFocus” (maybe occurred in the future).
Is it possible that be occurs in this case when the program execute “go.Diagram.prototype.doFocus.call(this)” the vertical scroll bar is moved up first and then execute “window.scrollTo(0,_top)” the vertical scroll bar is moved down. something like this.