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 from scope.$watch(scrollIfGlued); immediately after AJAX query done (it's noticeable from stacktrace), and scroll function is called too early, when el.scrollHeight isn't enought high.
The solution is
scope.$watch(function() {
$timeout(scrollIfGlued, 0, false);
});
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
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), andscrollfunction is called too early, whenel.scrollHeightisn'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