adopted-ember-addons / adopted-ember-addons/ember-collection
Allow hooking into scroll event instead of overriding
- Linguagem predominante
- JavaScript
- Estrelas
- 235
- Forks
- 81
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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:
```js
scrollChange(scrollLeft, scrollTop) {
this.set('scrollLeft', scrollLeft);
this.set('scrollTop', scrollTop);
}
```
... but in reality,[ there is more going on in the default scrollChange event](https://github.com/emberjs/ember-collection/blob/master/addon/components/ember-collection.js#L225-L239).
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.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.