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

TurboTable is not properly unbinding the body scroll listener #7074

Closed
danielthegray opened this issue Jan 4, 2019 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@danielthegray
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
The TurboTable ScrollBody component's scroll event listener is not being unbound correctly, it is rather being bound twice.
In table.ts:

2275     unbindEvents() {
2276         if (this.scrollHeaderViewChild && this.scrollHeaderViewChild.nativeElement) {
2277             this.scrollHeaderBoxViewChild.nativeElement.removeEventListener('scroll', this.headerScrollListener);
2278         }
2279
2280         if (this.scrollFooterViewChild && this.scrollFooterViewChild.nativeElement) {
2281             this.scrollFooterViewChild.nativeElement.removeEventListener('scroll', this.footerScrollListener);
2282         }
2283         //                                     vvv HERE
2284         this.scrollBodyViewChild.nativeElement.addEventListener('scroll', this.bodyScrollListener);
2285     }

Expected behavior
The event listener should be unbound instead of re-bound.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?
More correct behavior.

Please tell us about your environment:
any

  • Angular version: 5.X
    7.x

  • PrimeNG version: 5.X
    7.x

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

@cagataycivici cagataycivici self-assigned this Jan 7, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 7, 2019
@cagataycivici cagataycivici added this to the 7.0.4 milestone Jan 7, 2019
@cagataycivici
Copy link
Member

Fixed via PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants