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

how to deal with scroll event happened only one time #8

Open
una-chou opened this issue Jan 21, 2018 · 2 comments
Open

how to deal with scroll event happened only one time #8

una-chou opened this issue Jan 21, 2018 · 2 comments
Labels

Comments

@una-chou
Copy link

una-chou commented Jan 21, 2018

Thank you for your plugin, it's well, but when the offset=50, this scroll event will happen lots of time, and i wrote follow code to solve it, sometimes it is well, but if i scrolled fast, it's also a bug, how can i solve it perfectly?

` disabled = false;
onScrollModal() {
if(this.disabled == false){
this.scro();
this.disabled = false;
}
}

scro(){
        this.getIdentityGroupInfoNew(this.itemDataUuid, this.personType, this.identityGroup.length);
    this.disabled = true;
};`
@edoparearyee
Copy link
Collaborator

This might be a bug in the directive with the scroll$ observable, however looking at your code maybe try setting this.disabled before calling any other methods. E.g:

scro(){
  this.disabled = true;
  this.getIdentityGroupInfoNew(this.itemDataUuid, this.personType, this.identityGroup.length);
};

@una-chou
Copy link
Author

Thanks for your answer, but it doesn't work. I was set a setTimeout for this scroll event, now it is fine, but sometimes it will happen that bug again. If you have greater solution, answer me pls, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants