algolia / autocomplete

🔮 Fast and full-featured autocomplete library
https://alg.li/autocomplete
MIT License
5.06k stars 331 forks source link

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

Open fabswt opened 2 years ago

fabswt commented 2 years ago

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. Source: autocomplete-js:8

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 or the sandbox 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

Haroenv commented 2 years ago

If I read it correct, it's about these events: https://github.com/algolia/autocomplete/blob/05575dd245da073944a68afa859848014534ce72/examples/react-renderer/src/Autocomplete.tsx#L98-L105

In the past we haven't used passive events, because I thought it would break in IE11, but that needs to be verified

NathanSmeltzer commented 1 year ago

Is there an update on this? It would be nice to check this performance optimization improvement off for sites depending on this library.

botic commented 1 year ago

IE11 is in browser hell starting next week:

The out-of-support Internet Explorer 11 (IE11) desktop application is scheduled to be permanently disabled on certain versions of Windows 10 on February 14, 2023, through a Microsoft Edge update, not a Windows update as previously communicated. All remaining devices that have not already been redirected from IE11 to Microsoft Edge are scheduled to be redirected on February 14, 2023.

So this could be implemented in one of the next releases.