Closed amarchino closed 4 years ago
Ehmmm... I spent the last three days trying to tackle this problem... And mere hours after posting I found a possible solution.
Apparently, nor the window
object, nor the document
nor the body
will actually scroll: the scrolling element is still this.el.nativeElement.parentElement
.
Therefore my logging should have been written as
console.log(`this.el.nativeElement.parentElement.scrollTop: ${this.el.nativeElement.parentElement.scrollTop}`);
This issue may therefore be closed... But may I suggest @arkon to write some indications about this behavior (both the element to listen to while scrolling, and the element whose scroll value should be looked up) in the documentation, so as to help future users of Your library?
Thanks!
Greetings.
Referring to Issues #117 and #129 I added a directive to the
ng-sidebar-content
, read the the scroll event from its parent and tried to log the scrolling amount.It all works, except that the scrolling amount is always 0: more precisely
returns:
The subscription is just (excerpted from a mostly "clean" project)
Is anything wrong with the handling of the code? Should I not be able to retrieve the scrolling amount? Am I doing something wrong, or reading the wrong parameters to view the scroll?
Thanks