Famous / famous-angular

Bring structure to your Famo.us apps with the power of AngularJS. Famo.us/Angular integrates seamlessly with existing Angular and Famo.us apps.
https://famo.us/angular
Mozilla Public License 2.0
1.92k stars 275 forks source link

Sync moves multiple scrollViews at once #270

Closed steveblue closed 9 years ago

steveblue commented 10 years ago

When I create multiple scrollViews in a single state, the events for one scrollView propagate to all scrollViews. The behavior seems to be all horizontal scrollers start scrolling when user starts scrolling on one of them. If the user starts scrolling on a vertical scroller then all the rest of the vertical scrollers start scrolling. I can't replicate this behavior in Vanilla Famous.

In the docs for Multiple Scrollviews the example uses one EventHandler. This does not seem to work in practice. Even when I create separate EventHandlers for each Scrollview, the events still propagate to all Scrollviews. To fix the issue in our web app, I found I had to not just unpipe all EventHandlers other than the one attached to the current Scrollview, but also set all other Scrollview's renderNode.sync._eventInput to null on 'start' of the current Scrollview sync. This seems like a lot of overhead for something that seemingly should work out of the box.

jordanpapaleo commented 9 years ago

Hi Steve -

I am going to start looking at this. I just want to confirm it is still an issue first since its over a month old. Please confirm this is still valid.

Thanks,

Jordan

steveblue commented 9 years ago

Yep, still an issue.

jordanpapaleo commented 9 years ago

Thanks, do you have a code pen or another code example I can start with?

jordanpapaleo commented 9 years ago

Hey Steve -

I made a codepen with separate scroll views using different events handlers and it works. I also recreated the example from the docs and that seems to be working out of the box as well. Can you give provide me with some code or additional details? I'd love to work with you to get this issue resolved.

Thank you,

Jordan

steveblue commented 9 years ago

We are still seeing this issue in our web app when declaring scrollviews in different directives. Beyond giving you access to our repo (@zackbrown already has access), I can't replicate in a space like codepen. I had to create a service that detaches the eventHandlers from each scrollView so the events don't bubble. In some of our views we literally have over a dozen scrollviews on the page at once.