Jump to content
Search Community

Draggable Children - onPress firing with dragClickables: false

akapowl

Recommended Posts

Posted

Hello fellows!

 

On Draggables with clickable children, the onPress fires when clicking the child (black close button here) regardless of the Draggable having dragClickables set to false. There's an easy enough fix for that, checking on the event target and only firing if the target isn't the clickable child, but I don't think the onPress firing on those children is intended behaviour since the onRelease doesn't fire on those clickable children - or am I missing something?

 

 

 

EDIT:

Found an answer in a different thread already.

For anybody also having the feeling something is off; apparently it's not.

 

Quote

Yeah, as far as I can tell that's the correct behavior. The onPress fires either way, but then if it's determined to be a clickable object, it essentially ignores things thereafter related to that mouse event (internally it's like "wait! this is a clickable element so don't drag, and there's no need to listen for the release."). 

 

You can define your own logic in a clickableTest function that looks at whatever criteria you want.

by @GreenSock

 

 

See the Pen 7ad7f2d0c8173d66a6abb5be23769882 by akapowl (@akapowl) on CodePen.

  • Like 1

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...