Verified Commit a5f6d0b7 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Fix scrolling on FilteredListPage (Resolves #93)

parent 284d6f35
......@@ -139,9 +139,10 @@ export class FilteredListPage {
* @param {object} vnode
* @param {string} itemId id of the item to be shown on the details page
*/
oninit(vnode, itemId) {
oninit(_, itemId) {
// scroll events don't bubble up, so we need set useCapture to true for children scrollable elements
document.addEventListener('scroll', () => this.onscroll(), true);
this.scrollFunction = () => this.onscroll();
document.addEventListener('scroll', this.scrollFunction, true);
this.itemId = itemId;
......@@ -150,6 +151,10 @@ export class FilteredListPage {
}
}
onremove() {
document.removeEventListener('scroll', this.scrollFunction, true);
}
_handleItemDirectLink(itemId) {
if (!itemId) {
this.dataStore.shouldScroll = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment