thenikso / angular-inview

AngularJS directive to check if a DOM element is in the browser viewport.
http://thenikso.github.io/angular-inview/
MIT License
480 stars 112 forks source link

Does not trigger while user is dragging scroll bar #98

Closed cassdeckard closed 8 years ago

cassdeckard commented 8 years ago

If you scroll an element into view by clicking and dragging the scroll bar, the inview expression is not evaluated unless it is in frame at the time the user lets go of the scroll bar.

I am going to try to fix this and submit a pull request later today.

cassdeckard commented 8 years ago

Clarification: the issue is that it doesn't trigger while the user is dragging the scrollbar on a scrollable element within the page. It (probably) works for scrolling the full page (although I haven't checked)

cassdeckard commented 8 years ago

Whoops, for some reason merging this into my forked repo closed the issue.

thenikso commented 8 years ago

If I understood this properly, you mean to add the inview check to scroll events of custom elements.

Instead of doing this within the plugin, one could trigger the checkInView event on the window like so angular.element(window).triggerHandler('checkInView') inside a custom scroll event handler on any element.