xiaolin / react-image-gallery

React carousel image gallery component with thumbnail support 🖼
http://linxtion.com/demo/react-image-gallery
MIT License
3.8k stars 712 forks source link

Google Lighthouse audit error - does not use passive listeners #510

Closed a-tonchev closed 3 years ago

a-tonchev commented 4 years ago

When I make audit on my code it pop-up google chrome message to make the event listeners as passive:

image

Can you add this short fix?

With best regards

xiaolin commented 4 years ago

Can you show more debug information? I can't tell which line or function is causing this issue.

a-tonchev commented 4 years ago

Hello @xiaolin ,

thanks for the response. You can just open your demo here:

https://www.linxtion.com/demo/react-image-gallery/

And make Audit with google Lighthouse + Generate report. You will see under best practices the message I told you about:

image

I think that is the only issue that need to be fixed in code, and does not depend on image size etc.

a-tonchev commented 4 years ago

The error is comming from

react-swipable:

https://github.com/FormidableLabs/react-swipeable/commit/939ee9fdbc108e07af4ac1dfc5739f2db1a6f7d4

https://github.com/FormidableLabs/react-swipeable/pull/170

There are some suggestions how to fix this,

https://github.com/FormidableLabs/react-swipeable/blob/4.x/src/Swipeable.js#L80-L105

Best regards

xiaolin commented 3 years ago

I ran the audit on chrome incognito and I don't see the warning.

image

xiaolin commented 3 years ago

closing, feel free to open with steps to reproduce if the issue still exists.