Core Web Vitals CLS: Does a Load More Button Shift Count?
A layout shift that happens within 500 milliseconds of a click on a "Load more" button is not counted in Core Web Vitals CLS (Cumulative Layout Shift), even when the newly added items push down the button below them and the footer. A shift that happens more than 500 milliseconds after the click is counted, even if it is the same size. On the page I tested, CLS was 0 when the follow-up fetch took 0.4 seconds, and 0.1298 when it took 0.5 seconds. This article explains how to tell whether a list page with a Load more button, such as a product list or an article list, will have its CLS increased by the button.
The test environment was Ubuntu 24.04, Node.js 22, web-vitals 5.3.0, and Lighthouse 13.6.0. The browser was Chrome for Testing 153, which comes with Playwright 1.63.0. The test page was served from a small server I ran locally at localhost:8080. The fetch time was delayed by the server on purpose. The screen size was 412px wide and 823px high. I tested with mouse clicks and with the Enter key on the keyboard. I did not test smartphone taps, infinite scroll (loading more automatically while scrolling), the normal Lighthouse measurement (navigation), or real user data (PageSpeed Insights field data or Search Console).
The test page
The page has a header and heading, followed by three article cards, a "Load more" button, and a footer. Pressing the button adds three more cards (each card is 112px high). The delay URL parameter sets how long the follow-up fetch takes. If delay is not set, the page adds the cards right away without fetching.
…
<ul id="list">
<li class="card">記事 1:猫の手で書いた記事の紹介文です。</li>
…(カードは全部で3枚)
</ul>
<button id="more">もっと見る</button>
</main>
<footer>フッター(運営者の情報など)</footer>
<script>
const params = new URLSearchParams(location.search);
const delay = params.get('delay'); // Time the fetch takes (ms). If not set, the cards are added immediately without fetching
const skeleton = params.get('skeleton'); // Whether to add placeholder slots at click time (short for shorter placeholders)
…
document.getElementById('more').addEventListener('click', async () => {
if (delay === null) {
…
list.append(...makeCards(titles));
return;
}
let slots = [];
if (skeleton !== null) {
slots = [0, 1, 2].map(() => Object.assign(document.createElement('li'), { className: skeleton === 'short' ? 'card skeleton short' : 'card skeleton' }));
list.append(...slots);
}
const res = await fetch(`/items.json?from=${next}&delay=${delay}`);
const titles = await res.json();
next += titles.length;
if (skeleton !== null) slots.forEach((li, i) => { li.className = 'card'; li.textContent = titles[i]; });
else list.append(...makeCards(titles));
});
</script>
For measurement, I wrote a script (measure.cjs) that runs with Playwright. It opens the page, presses "Load more" one second later, waits three seconds, and then prints the layout-shift entries received through a PerformanceObserver and the CLS reported by web-vitals
onCLS. In the output, input+…ms is the time from the click until the shift happened.
Shifts within 0.5 seconds of the click were not counted
First, I measured the case where the cards were added immediately without a fetch. I tested a mouse click and an Enter key press.
$ node measure.cjs ":click" ":enter" "delay=300" "delay=400" "delay=500" "delay=600" "delay=800" "delay=800&skeleton" "delay=800&skeleton=short"
(取得なし) click: input at 1111ms, footer.top 569 -> 941
shift t=1113 (input+2ms) value=0.1298 hadRecentInput=true sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.0000 rating=good
(取得なし) enter: input at 1060ms, footer.top 569 -> 941
shift t=1076 (input+16ms) value=0.1309 hadRecentInput=true sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [496.390625,50]->[0,0]
web-vitals onCLS: 0.0000 rating=good
…
One shift happened right after the press. The footer and the button moved. The top of the footer went from 569px to 941px, which put it outside the 823px-high screen. The shift value was 0.1298 (0.1309 with Enter). By itself, that is above the "good" threshold of 0.1 for CLS. Even so, web-vitals onCLS reported 0.
The difference is hadRecentInput=true. The web.dev explanation of CLS says that a layout shift that happens within 500 milliseconds of user input is marked with hadRecentInput and can be excluded from the CLS calculation. This input is limited to discrete actions such as taps, clicks, and key presses. Scrolling, dragging, and pinch zoom are not included.
I also made the follow-up fetch take 0.3 and 0.4 seconds, and the result was the same. The output below is from the same run, with only the relevant rows for those pages extracted.
delay=300 click: input at 1076ms, footer.top 569 -> 941
shift t=1383 (input+307ms) value=0.1298 hadRecentInput=true sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.0000 rating=good
delay=400 click: input at 1082ms, footer.top 569 -> 941
shift t=1488 (input+406ms) value=0.1298 hadRecentInput=true sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.0000 rating=good
After 0.5 seconds, the same shift was counted
When the fetch took 0.5 seconds or longer, the shift was the same size (0.1298), but hadRecentInput was false, and the shift was counted in CLS.
delay=500 click: input at 1086ms, footer.top 569 -> 941
shift t=1594 (input+508ms) value=0.1298 hadRecentInput=false sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.1298 rating=needs-improvement
delay=600 click: input at 1077ms, footer.top 569 -> 941
shift t=1684 (input+607ms) value=0.1298 hadRecentInput=false sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.1298 rating=needs-improvement
delay=800 click: input at 1073ms, footer.top 569 -> 941
shift t=1881 (input+808ms) value=0.1298 hadRecentInput=false sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.1298 rating=needs-improvement
CLS was 0.1298, and web-vitals rated it needs-improvement. The web.dev explanation says that a "good" CLS is 0.1 or less. In web-vitals 5.3.0, the boundaries are set as CLSThresholds = [0.1, 0.25]. The button press was the same in each case, but the page fell out of the "good" range only because the follow-up content arrived later.
| Time from click to shift | hadRecentInput | web-vitals CLS |
|---|---|---|
| 2ms (no fetch, click) | true | 0 |
| 16ms (no fetch, Enter) | true | 0 |
| 307ms (0.3s fetch) | true | 0 |
| 406ms (0.4s fetch) | true | 0 |
| 508ms (0.5s fetch) | false | 0.1298 |
| 607ms (0.6s fetch) | false | 0.1298 |
| 808ms (0.8s fetch) | false | 0.1298 |

With placeholders added at click time, CLS was 0 even with a 0.8-second fetch
The web.dev article on improving CLS says that you should let the user start the loading, as with a "Load more" button, and that a shift within 500 milliseconds of the user's action is not counted in CLS. It also says that when a fetch may take longer than 500 milliseconds, you can reserve the space during those 500 milliseconds so that the shift happens earlier, outside the window that counts.
On the test page, I added three empty gray cards (card skeleton) as soon as the button was pressed, and filled in their text when the fetch finished. This is the if (skeleton !== null) part of the code shown earlier. The fetch took 0.8 seconds.
delay=800&skeleton click: input at 1080ms, footer.top 569 -> 941
shift t=1082 (input+2ms) value=0.1298 hadRecentInput=true sources=FOOTER [y,h] [569.390625,192]->[0,0], BUTTON#more [y,h] [497.390625,48]->[0,0]
web-vitals onCLS: 0.0000 rating=good
There was only one shift, 2ms after the press. It had hadRecentInput=true, so CLS was 0. When the text was filled in 0.8 seconds later, the card height did not change, so no shift was recorded.
I also tried a page where the placeholder cards were half the height of the real cards (56px). With skeleton=short in the URL, the placeholder cards get the short class, and the CSS .card.skeleton.short { height: 56px; } makes them shorter. The shift at click time was not counted. But when the text filled in 0.8 seconds later and the cards grew to 112px, another shift happened, and that one was counted.
delay=800&skeleton=short click: input at 1073ms, footer.top 569 -> 941
shift t=1075 (input+2ms) value=0.0862 hadRecentInput=true sources=FOOTER [y,h] [569.390625,192]->[773.390625,49.609375], BUTTON#more [y,h] [497.390625,48]->[701.390625,48]
shift t=1880 (input+807ms) value=0.06 hadRecentInput=false sources=LI [y,h] [565.390625,56]->[621.390625,112], LI [y,h] [633.390625,56]->[745.390625,77.609375], FOOTER [y,h] [773.390625,49.609375]->[0,0], BUTTON#more [y,h] [701.390625,48]->[0,0]
web-vitals onCLS: 0.0600 rating=good
CLS was 0.06. That is within the "good" range, but it was not 0. The placeholder cards must be the same height as the loaded cards.
Lighthouse timespan: reproducing slow networking exceeded 0.5 seconds
Lighthouse has a timespan mode that measures a set period of time that includes user interactions. The web.dev article also suggests it as a way to check whether layout shifts increase during a user flow. The default navigation mode measures a single page load, so to measure shifts after pressing "Load more," I used the timespan mode.
I ran a Lighthouse 13.6.0 user flow from Node.js, with a script (flow.mjs) that presses "Load more" one second after the measurement starts. With a 0.3-second fetch, Playwright had measured a CLS of 0, but Lighthouse measured 0.13.
$ node flow.mjs ":1000" "delay=300:1000:on" "delay=300:1000:off" "delay=800:1000:off" "delay=800&skeleton:1000:on" ":0:on"
(取得なし) wait=1000ms throttle=on: lighthouse 13.6.0 gatherMode=timespan screen=412x823 throttlingMethod=devtools
timespan CLS: 0 (numericValue 0.0000, score 1)
delay=300 wait=1000ms throttle=on: lighthouse 13.6.0 gatherMode=timespan screen=412x823 throttlingMethod=devtools
/items.json: 568ms
timespan CLS: 0.13 (numericValue 0.1298, score 0.82)
- body > footer score=0.1298
delay=300 wait=1000ms throttle=off: lighthouse 13.6.0 gatherMode=timespan screen=412x823 throttlingMethod=provided
/items.json: 304ms
timespan CLS: 0 (numericValue 0.0000, score 1)
…
The cause is the network slowdown that Lighthouse simulates. In Lighthouse 13.6.0, the default throttling is simulate, which estimates a slow mobile connection (mobileSlow4G). In timespan mode, this is replaced with devtools, which actually slows the browser's network requests. In that mode, the request latency given to the browser (requestLatencyMs) is 150 * 3.75, which is 562.5 milliseconds. In fact, the /items.json response, which the server delayed by 0.3 seconds, took 568ms, and the shift was counted because it happened after 0.5 seconds. With throttling turned off (throttlingMethod: 'provided'), the response arrived in 304ms, and CLS was 0.
So the same 0.3-second page was not counted when network slowdown was not reproduced, but was counted when a slow mobile connection was reproduced.
A page that added placeholders at click time still had a CLS of 0 with network throttling on.
delay=800&skeleton wait=1000ms throttle=on: lighthouse 13.6.0 gatherMode=timespan screen=412x823 throttlingMethod=devtools
/items.json: 809ms
timespan CLS: 0 (numericValue 0.0000, score 1)
One more case: when I pressed the button right after starting the measurement, the page without a fetch also reached a CLS of 0.13.
(取得なし) wait=0ms throttle=on: lighthouse 13.6.0 gatherMode=timespan screen=412x823 throttlingMethod=devtools
timespan CLS: 0.13 (numericValue 0.1298, score 0.82)
- body > footer score=0.1298
A comment in the part of Lighthouse 13.6.0 that calculates CLS (core/computed/metrics/cumulative-layout-shift.js) says that Chrome can add had_recent_input even when the screen size emulation is changed. Because of this, Lighthouse counts shifts within 500 milliseconds from the start of recording (or from the point where the recording changed the screen size) even if they have had_recent_input. However, if there was even one shift before that point without this flag, those shifts are not counted. When testing "Load more" in timespan mode, if you wait longer than 500 milliseconds after starting the measurement (I used one second) before pressing the button, you can see only the shifts caused by the press.





