-
Notifications
You must be signed in to change notification settings - Fork 78
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
Feature: Scroll offset instead of target #28
Comments
@HarelM Thanks for the above examples. I've looked into it and as far as I can see, the following is desired:
Can you conform and/or update these statements? It makes it a little clearer on what needs to be done. |
I think you understood it correctly. |
@HarelM updated my comment, you're right, |
Any updates on this? |
@HarelM I've been away for a little while. Will get back to this soon enough, apologies for the delay! I'll keep you posted when the feature is implemented. |
The module can now be used to scroll to a specific offset instead of a target. The offset can be used in both the Directive and the Service. This closes #28
@HarelM I'm happy to announce this feature has been implemented as of today. It is available on version 0.6.0. Please refer to Directive Example or Service Example for more details. Thanks again for your issue, it is much appreciated! |
Thanks!! |
Is it possible the documentation is incorrect? ...
const config: ScrollToConfigOptions = {
offset
};
... |
Hi, console.log("after init, pos: " + this.state.scrollPosition);
this.scrollToService.scrollTo({ offset: this.state.scrollPosition, container: this.dialogContent.nativeElement } as ScrollToConfigOptions).toPromise().then(() => {
console.log("after scroll pos: " + this.dialogContent.nativeElement.scrollTop);
}); And am getting the following in the console:
I've seen that when using this service the scroll position does not get to the right place after reopening my dialog. |
@HarelM I'm not sure what part you consider incorrect, but if you mean the |
Yeah it would be very useful to have a plunkr or Stackblitz for that! Let me know when you have it and I'll take a look! |
I'll see if I can reproduce in stackblitz... |
Scroll position is set to: 107 (should be at the end) but when loaded it gets to around 25 only (top-middle): |
@HarelM You're right, the offset is not correct when used inside a nested container. You can clearly see the different when i set the container at the very top of the page, because the offset then does work. Tested in a forked Stackblitz here. I'll create a new issue to solve this. Thanks again, useful feedback! |
@HarelM Oh I forgot to say, for now to fix this, you'll probably be able to add the offsetTop of the |
Thanks for the quick response! |
To continue the discussion at issue #10:
here is a snippet describing what I want to achieve with some comment to help clarify:
Here's my current implementation without JQuery:
The text was updated successfully, but these errors were encountered: