Loading...
input.addEventListener('input', (e) => {
results.render(filterAll(items, e.target.value));
});input.addEventListener('input', (e) => {
showSpinner();
setTimeout(() => {
results.render(filterAll(items, e.target.value));
}, 0);
});Deferring the heavy filter lets the browser paint the input change first, so the next paint is not blocked.
200 ms or less at the 75th percentile of visits is good, and over 500 ms is poor.
FID measured only the input delay of the first interaction. INP measures the full time to the next paint across all interactions and reports one of the slowest.
Lab tests barely interact with the page and run on fast hardware, while real users click and type on slower phones.