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

Setting Layer.draggable.enabled = true while in Events.TouchStart doesn't immediately start drag #243

Open
WestonThayer opened this issue Sep 4, 2015 · 2 comments
Labels

Comments

@WestonThayer
Copy link

You have to set Layer.draggable.enabled = false when you initialize the layer for this scenario to work. A common usage is to use the "long press" gesture to "pick up" a layer for dragging. For example:

layerA = new Layer().center()

# Uncomment to fix bug
# layerA.draggable.enabled = false

layerA.on Events.TouchStart, (event) ->
    Utils.delay 0.5, () ->
        layerA.draggable.enabled = true
  1. Long press on layerA
  2. Begin to drag

Actual: layerA doesn't drag, remains put. If you lift your finger, then attempt to drag again, it works
Expected: layerA drags

@nvh nvh added the bug label Aug 2, 2016
@nvh
Copy link
Collaborator

nvh commented Aug 2, 2016

This is indeed a bug. It's caused by layer.draggable only being created upon access.

@joetheday
Copy link

I have encountered this same issue. Any plans to fix this bug?

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

No branches or pull requests

3 participants