Jump to content
Search Community

Non-passive Events being called out in newer Chrome

NoahRodenbeek test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

The newer version(s?) of Chrome are logging a warning about event listeners declared without a passive state. It looks harmless for now, I just wondered if there were plans to add this functionality, or if there's an existing option I'm not seeing that I just need to add. So far I'm only noticing it with Draggable.


Screen Shot 2018-04-20 at 11.52.12 AM.png

See the Pen JvjLyg by GreenSock (@GreenSock) on CodePen

  • Like 1
Link to comment
Share on other sites

Actually, it would be totally inappropriate to set the {passive:true} flag on Draggable's listeners because that's essentially promising the browser that we'll never call preventDefault() on the event to cancel the scroll...but Draggable MUST do exactly that. Otherwise, when you press down on something and start dragging, the whole page would move with it. See what I mean? 


Don't worry about those "warnings" - they're not errors or anything. It's just Chrome trying to be "helpful" but it has no idea what the code actually needs to do or what would be appropriate in our context :)


I appreciate you asking about this, though. Sometimes things like this are really useful for us to hear about. 

  • Like 3
Link to comment
Share on other sites

Yeah, super "helpful". It looks like there's a way to explicitly say `false` to also avoid the warning log, but it might not be worth the effort to work into Draggable.


That should really be on Chrome to accept a default value without polluting the console. Thanks for the response!

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...