Fix Cytoscape.js crash on navigation away from network map
- Stop running layout before destroy to prevent async callbacks hitting null renderer - Set wheelSensitivity to 1 (default) to suppress console warning
This commit is contained in:
parent
29c2039832
commit
b1438204df
1 changed files with 6 additions and 1 deletions
|
|
@ -588,6 +588,11 @@ const NetworkMap = {
|
|||
|
||||
destroyed(this: any) {
|
||||
if (this.cy) {
|
||||
// Stop any running layout before destroying to prevent async callbacks
|
||||
// from accessing a destroyed renderer
|
||||
try {
|
||||
this.cy.stop()
|
||||
} catch (_e) { /* ignore */ }
|
||||
this.cy.destroy()
|
||||
this.cy = null
|
||||
}
|
||||
|
|
@ -803,7 +808,7 @@ const NetworkMap = {
|
|||
},
|
||||
minZoom: 0.2,
|
||||
maxZoom: 3,
|
||||
wheelSensitivity: 0.2
|
||||
wheelSensitivity: 1
|
||||
})
|
||||
|
||||
// Add click handler for nodes
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue