diff --git a/packages/rum-core/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts b/packages/rum-core/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts index d9dc30364e..7ef121b642 100644 --- a/packages/rum-core/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +++ b/packages/rum-core/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts @@ -76,7 +76,7 @@ export function trackCumulativeLayoutShift( if ( isExperimentalFeatureEnabled(ExperimentalFeature.WEB_VITALS_ATTRIBUTION) && clsTarget && - clsTarget.parentElement + clsTarget.isConnected ) { const selectorComputationStart = relativeNow() cslTargetSelector = getSelectorFromElement(clsTarget, configuration.actionNameAttribute)