We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94dea74 commit c800954Copy full SHA for c800954
packages/overhead-metrics/src/vitals/cls.ts
@@ -12,12 +12,10 @@ class CLS {
12
13
const observer = new PerformanceObserver((list) => {
14
for (const entry of list.getEntries()) {
15
- if (!entry.hadRecentInput) {
16
- if (window.cumulativeLayoutShiftScore === undefined) {
17
- window.cumulativeLayoutShiftScore = entry.value;
18
- } else {
19
- window.cumulativeLayoutShiftScore += entry.value;
20
- }
+ if (window.cumulativeLayoutShiftScore === undefined) {
+ window.cumulativeLayoutShiftScore = entry.value;
+ } else if (!entry.hadRecentInput) {
+ window.cumulativeLayoutShiftScore += entry.value;
21
}
22
23
});
0 commit comments