mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[APM] Don't trigger map layout if no elements (#66625)
After simplyfying the layout mechanism in #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 #66528.
This commit is contained in:
parent
e6ef168181
commit
a54de76e1f
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue