-
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
scroll goes too soon #38
Comments
I can confirm that the "fix" from kukunin is working for me, I have a similar case where messages are updated asynchronically . |
👍 Looking forward for a fix to async messages as well |
My bad it does seem to be fixed in the latest version, npm is still on 2.0.4 that's why it wasn't working on my end. |
Yea I have requested NPM parity in a separate issue, but have not heard from the author. It has been 4.5 months since I created that issue. I think this author is not-so-committed to this being a public project. Maybe someone will eventually fork and be committed to maintaining? |
Just want to note that:
Did not work for me, but:
Did. |
I can confirm this. The In addition to running the function at the end of the $digest cycle, I also wanted to delay it a bit (like @twelve6 mentioned) and add some debouncing. I ended up at this: scope.$watch(() => {
const ctx = this;
if (ctx.watchPromise === undefined) {
ctx.watchPromise = $timeout(() => {
scrollIfGlued();
ctx.watchPromise = undefined;
}, 10, false);
}
}); This way, the |
It seems reasonable to debounce this behavior. If you could provide the change as a pull request, that'd be great. |
Actually it still does not work properly in all cases 🙁 Still debugging... |
Hello here. I'm trying to use this directive for my case, and it seems it doesn't work properly.
I have scrollable div, with AJAX messages there. So, I expect, that after message is added, container will scroll down for it. But, it doesn't work.
My inverstigations:
$window.addEventListener('resize', scrollIfGlued, false);
doesn't call the callback. Callback is called fromscope.$watch(scrollIfGlued);
immediately after AJAX query done (it's noticeable from stacktrace), andscroll
function is called too early, whenel.scrollHeight
isn't enought high.The solution is
I'd commit pull request, but test fails for me, and I can't repair them.
I understand, it sounds like edge case, but it will make directive more robust
The text was updated successfully, but these errors were encountered: