Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fabswt opened this issue Apr 29, 2022 · 3 comments

Comments

@fabswt
Copy link

fabswt commented Apr 29, 2022

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

  • OS: macOS
  • Browser: Version 1.38.109 Chromium: 101.0.4951.41 (Official Build) (arm64)
  • Autocomplete version: 1.6.2
@Haroenv
Copy link
Contributor

Haroenv commented Apr 29, 2022

If I read it correct, it's about these events:

window.addEventListener('touchstart', onTouchStart);
window.addEventListener('touchmove', onTouchMove);
return () => {
window.removeEventListener('touchstart', onTouchStart);
window.removeEventListener('touchmove', onTouchMove);
};
}, [getEnvironmentProps, formRef, inputRef, panelRef]);

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

@NathanSmeltzer
Copy link

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

@botic
Copy link

botic commented Feb 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants