We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cb7947 commit ea23da2Copy full SHA for ea23da2
vertical-collection/addon/-private/data-view/utils/scroll-handler.js
@@ -50,11 +50,14 @@ export class ScrollHandler {
50
}
51
52
// TODO add explicit test
53
- if (this.isUsingPassive && handlers.length === 1) {
54
- element.addEventListener('scroll', cache.passiveHandler, {
55
- capture: true,
56
- passive: true,
57
- });
+ if (this.isUsingPassive) {
+ // Only add the event listener once, if more handlers are present.
+ if (handlers.length === 1) {
+ element.addEventListener('scroll', cache.passiveHandler, {
+ capture: true,
58
+ passive: true,
59
+ });
60
+ }
61
62
63
} else if (!this.isPolling) {
0 commit comments