Skip to content
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

Continuously scrolling is not responsive enough #21

Closed
Martinsos opened this issue Aug 20, 2014 · 9 comments
Closed

Continuously scrolling is not responsive enough #21

Martinsos opened this issue Aug 20, 2014 · 9 comments

Comments

@Martinsos
Copy link

Hi, first of all, thank you for creating this great module!
I noticed a possible bug: inview does not trigger until user does not stop scrolling. So if user is continuously scrolling (for example using touchpad on laptop), inview does not trigger. Can you confirm that is happening? Is that expected behaviour and limitation of angular inview, or a bug?
Thank you!

@Martinsos Martinsos changed the title Bug on mac and iPad Bug when continuously scrolling Aug 20, 2014
@ryanmclaughlin
Copy link

I'm experiencing this as well.

@4storia
Copy link

4storia commented Sep 19, 2014

Line 256 of the source has
return timer = setTimeout(f, t != null ? t : 100);
If you need the scroll event to fire more frequently, lower the 100 to something smaller, ie
return timer = setTimeout(f, t != null ? t : 40);

@thenikso
Copy link
Owner

would you think parametrizing that debounce timer would make sense? possibly setting it at 0 to remove the debounce entirely.

What would a good way of parametrizing it look like to you? Would a provider be too much? maybe a constant would suffice. opinions?

@arthur-white
Copy link

On second thought,
as soon as the scrolling begins /* Turn on polling every n miliseconds /
When the scrolling stops /
Do a debounced stop polling call */

@Martinsos
Copy link
Author

Is javascript executing while scrolling is happening?

@thenikso
Copy link
Owner

thenikso commented Oct 3, 2014

there is no polling, only debouncing of scroll events to 100ms. Javascript is always executing when scrolling (now also on iOS8).

@urecio
Copy link

urecio commented Oct 31, 2014

Hi, I think this could be better if we can configure it.
I have created a pull request
#35

@thenikso
Copy link
Owner

thenikso commented Nov 3, 2014

I was planning to introduce another breaking change (I like those) by deprecating in-view-offset and add in-view-options (much like the new ng-model-options) which may work like:

<any in-view="$inview&&someFunction()" in-view-options="{ offsetTop:100, offsetBottom:0, debounce:100 }"></any>

The default debounce value may be 0 (meaning no debounce at all).

@thenikso thenikso changed the title Bug when continuously scrolling Continuously scrolling is not responsive enough Nov 3, 2014
@thenikso
Copy link
Owner

thenikso commented Nov 4, 2014

With the PR #36 now published as version 1.5.0 this should be fixed. Tests are appreciated!

@thenikso thenikso closed this as completed Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants