Closed antoniogarrote closed 7 years ago
If the callbacks are connected correctly, this might be happening because the editor is not visible when the user selects the element in the diagram and the callbacks are executed.
Note: the main issue is solved here but now there's another bug related to scrolling:
Regarding scrolling bug: It turned out it appears both in raml and openapi tabs. To reproduce - in WorkMusicAPI Graph click at /api GET and then go to RAML or OpenAPI. On first open scrolling won't be correct. I've discovered this issue related to scrolling happening before
this.editor.setModel
inonEditorSectionChange
finishes work. The simplest solution that may fail is to runselectElementDocument
with timeout of 1 second. Other solution would be to somehow queue its execution aftersetModel
finishes. One way to do that iseditor.onDidChangeConfiguration
event, but it's not always fired when tab changes. Also it's fired billion times when window size changes.
When a model element is selected in the diagram, not only the element in the navigation sidebar must be selected but the text of the editor must be scrolled to that element and selected.
Changes in scrolling should be visible when the user switches from graph to editor.