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

bubbleParent: false on child view not respected #14

Open
mikefogg opened this issue Oct 24, 2014 · 3 comments
Open

bubbleParent: false on child view not respected #14

mikefogg opened this issue Oct 24, 2014 · 3 comments

Comments

@mikefogg
Copy link

This could be a stupid question, so, feel free to tell me so :)

I'm working on an app that has a tableView inside of a draggableView. Everything works flawlessly until I added the ability to rearrange items in the table. It seems like when I'm rearranging items it's firing the start/move/end events on the draggable view (and I can only move the rows about 10px up and down from their original position).

My first thought was that's fine becuase I can just set bubbleParent to false on the table and it won't fire other events, but that didn't work. Here's what I tried:

1) On setting the table to moveable:

Set the DraggableView to enabled:false

2) On setting the table to moveable:

Set the DraggableView to enabled:false
Set the tableView to bubbleParent: false

3) On setting the table to moveable:

Set the DraggableView to enabled:false
Set the tableView to bubbleParent: false
Add the tableView to another view, and setting that to bubbleParent false as well

None of those seemed to work unfortunately.

I was curious if you had any suggestions that may point me in the right direction?

Also thanks for this amazing module :)

@mikefogg
Copy link
Author

Threw this together quickly so you could see what I mean incase it helps. Just have to add the TiDraggable Module and should be good!

https://gist.github.com/mikefogg/c3d75c5ce6c3d32b4727

@mikefogg
Copy link
Author

I'm going to leave this ticket open for now, but for a reference I've made a change that allows me to really disable and re-enable the draggable view by adding a function to add/remove the gesture recognizer.

mikefogg@bebd0dd

// Example button to enable moving on the table
move_button.addEventListener("click", function(e){
  DraggableView.draggable.removeGesture();
  table_view.moving = true;
});

// Example button to disable moving on the table
done_button.addEventListener("click", function(e){
  DraggableView.draggable.addGesture();
  table_view.moving = false;
});

@krmannix
Copy link

krmannix commented Oct 9, 2015

@mikefogg I forked this repo & used inspiration from your commit to apply it to our specific use case (Issue #32). Thanks so much!

https://github.com/VerbalApplicationsInc/TiDraggable

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

2 participants