Skip to content
/ kibana Public
forked from elastic/kibana

Commit

Permalink
[APM] Don't trigger map layout if no elements (elastic#66625)
Browse files Browse the repository at this point in the history
After simplyfying the layout mechanism in elastic#66438, we made it so the `data` event handler would run even if there are no elements. This causes the `layoutstop` handler to run as well, but if we have multiple renders with no elements, multiple `layoutstop` events would by triggered after the elements were loaded, causing the map to jump around, which is especially visible with a single node.

Fixes elastic#66528.
  • Loading branch information
smith committed May 14, 2020
1 parent 5f57ad1 commit 2ae6a78
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function Cytoscape({
};

const dataHandler: cytoscape.EventHandler = event => {
if (cy) {
if (cy && cy.elements().length > 0) {
if (serviceName) {
resetConnectedEdgeStyle(cy.getElementById(serviceName));
// Add the "primary" class to the node if its id matches the serviceName.
Expand Down

0 comments on commit 2ae6a78

Please sign in to comment.