algolia / algolia/autocomplete

Lighthouse report: "Does not use passive listeners to improve scrolling performance"

Open
#961 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
341
Avg merge
2d 4h
Merged PRs (30d)
7

Description

## Description

Not exactly a bug, but Google Lighthouse will keep complaining about this unless it's fixed.

When running Lighthouse inside of Chrome, getting this in the report:

image

> Does not use passive listeners to improve scrolling performance
> Consider marking your touch and wheel event listeners as `passive` to improve your page's scroll performance. [Learn more.](https://web.dev/uses-passive-event-listeners/?utm_source=lighthouse&utm_medium=devtools)
> Source: [autocomplete-js:8](https://cdn.jsdelivr.net/npm/@algolia/autocomplete-js)

That's with the latest version (1.6.2 at the time of writing.)

## Reproduction

I get the same report from Lighthouse whether I run the test on [my on website](https://bilingueanglais.com/blog/15431/methodes-d-anglais/) or [the sandbox](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx) in its own window.

## Expected behavior

If possible, would expect the library to use `passive` to possibly improve performance and pass the Lighthouse test.

## Environment

- OS: macOS
- Browser: Version 1.38.109 Chromium: 101.0.4951.41 (Official Build) (arm64)
- Autocomplete version: 1.6.2

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Lighthouse warning in the linked CodeSandbox playground at app.tsx, using the reported autocomplete-js 1.6.2 setup. Trace the library's touch and wheel listeners and verify the result with Lighthouse; done means the passive-listener warning is no longer reported without breaking autocomplete interaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.