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

Allow hooking into scroll event instead of overriding #145

Open
danwenzel opened this issue Feb 24, 2017 · 4 comments
Open

Allow hooking into scroll event instead of overriding #145

danwenzel opened this issue Feb 24, 2017 · 4 comments

Comments

@danwenzel
Copy link

danwenzel commented Feb 24, 2017

With the current functionality, you can interact with ember-collection's scroll event. But this requires you to completely override the default scroll-change action.

The docs show the following example as a way to maintain current scroll behavior:

scrollChange(scrollLeft, scrollTop) {
  this.set('scrollLeft', scrollLeft);
  this.set('scrollTop', scrollTop);
}

... but in reality, there is more going on in the default scrollChange event.

As a result, you end up losing some functionality when overriding this function. I tried to do this and ended up with some weird behavior (studdering scrolls at certain zoom levels), so I had to build my own scroll listener.

I propose we build a hook that can be optionally used when calling ember-collection. Then, ember-collection's scroll listener will call this hook function if present and still run its own code.

I'd be happy to create a PR for this if you feel it is a good idea.

@danwenzel
Copy link
Author

Any ideas on this? Again, I'm happy to open a PR.

@danwenzel
Copy link
Author

Trying again. Anyone have ideas on this?

@Luiz-N
Copy link

Luiz-N commented Aug 12, 2017

Is this the kind of thing you're looking for? #137

@danwenzel
Copy link
Author

@Luiz-N - Not really... I'm looking for the ability to hook into the existing scroll event, so you can run a custom function when the user scrolls the list.

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