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

Sometimes on scrolling down the contents starts rerending continously #176

Closed
ansari9546 opened this issue Mar 28, 2020 · 26 comments
Closed

Comments

@ansari9546
Copy link

Sometimes on scrolling down the list the cluster starts re-render the data continously. Try to debug but when the console opens it mostly automatically fixed. And sometime from debugginf I find out that the cluster calculates the height and starts renders data continously. I loads data asynchrously and changes the states of data using cluster.update method. I don`t have fixed scenario for this. If anyone have solution please help me

@Ladvace
Copy link

Ladvace commented Jun 1, 2020

does it start flickering?

@ansari9546
Copy link
Author

Yes it does.

@Ladvace
Copy link

Ladvace commented Jun 1, 2020

yeah also to me and I'm trying to figure out the problem

@ansari9546
Copy link
Author

At this moment I have solved it for the time being to get the scroll event and on that basis I tried to refresh the cluster. Somehow this potential fix works for me

@Ladvace
Copy link

Ladvace commented Jun 1, 2020

I will try

@Ladvace
Copy link

Ladvace commented Jun 1, 2020

actually don't seems to working for me

@ansari9546
Copy link
Author

cluster.getScrollProgress() helps me to tackle the issue to flicker. I used my logic further to detect whether it is flickering or not.

@Ladvace
Copy link

Ladvace commented Jun 2, 2020

and when u detect it what did you do?

@Ladvace
Copy link

Ladvace commented Jun 2, 2020

i tried using .getScrollProgress() but i just get an initial 0, if I scroll it doesn't change

@ansari9546
Copy link
Author

use cluster.refresh() to solve the flickering

@ansari9546
Copy link
Author

If the listing starts flickering then the getScrollProgress() will be called continously. Now whether you will get the same scrollIndex of fluctuated between 2-3 index values. when you get that simply refresh the cluster. It will solve the problem of flickering.

@Ladvace
Copy link

Ladvace commented Jun 2, 2020

for me getScrollProgress() is called just once

@FeehGb
Copy link

FeehGb commented Dec 4, 2020

how did you fix it ?

@ansari9546
Copy link
Author

I fixed it by using the getScrollProgress() if progress remains the same on getting the event then I call the custerize.refresh() event.
this trick works well for me

@FeehGb
Copy link

FeehGb commented Dec 9, 2020

Can you show me in the code where did you put getScrollProgress to detect it.
Thanks

@NeXTs
Copy link
Owner

NeXTs commented Dec 10, 2020

Hello guys
Could you provide a demo at codepen?

@ansari9546
Copy link
Author

@FeehGb you can use the below demo link that shows how I have tried to fix this issue.
https://codepen.io/arsalanansari9546/pen/KKgajWa

@FeehGb
Copy link

FeehGb commented Dec 14, 2020

thanks.
It will help me a lot.

@fmp777
Copy link

fmp777 commented Dec 16, 2021

@FeehGb you can use the below demo link that shows how I have tried to fix this issue. https://codepen.io/arsalanansari9546/pen/KKgajWa

With your patch, the flickering (rapid redrawing of content) stops, but i also end up with missing data/elements on page. ie: scroll down to bottom, then back to top and the top is missing. Also the bottom of list is missing if you scroll to bottom from top.

This seems like something that needs to be fixed internally, no? I'm not quite clear what the actual problem is.

@FeehGb
Copy link

FeehGb commented Dec 16, 2021

@fmp777 I fixed this problem. I set the fixed heigth for each element.
#181

@fmp777
Copy link

fmp777 commented Dec 16, 2021

@fmp777 I fixed this problem. I set the fixed heigth for each element. #181

Hmm, i've implemented your patch, and after setting a fixed height for each element, flicker gone, and no missing elements.

Setting a fixed height is not ideal in many situations, i wonder if there's a way around that...

@NeXTs NeXTs closed this as completed in 0cbaebe Dec 19, 2021
@HiveBotNoon
Copy link

This issue is not fixed for me even with the latest version. There are also some more issues that were not there before e.g. if the clusterize has more elements than "rows_in_block" it is not showing the elements at all, only after having called .refresh(true)

Any advice?

@fmp777
Copy link

fmp777 commented Jul 19, 2022

yea the issue has reappeared - with no updates to Clusterize or other JS - must be a browser change that now brought this problem back

@NeXTs
Copy link
Owner

NeXTs commented Jul 19, 2022

yea the issue has reappeared - with no updates to Clusterize or other JS - must be a browser change that now brought this problem back

what browser? OS?

@fmp777
Copy link

fmp777 commented Jul 19, 2022

yea the issue has reappeared - with no updates to Clusterize or other JS - must be a browser change that now brought this problem back

what browser? OS?

IOS / Chrome / Safari / Webkit

I'm actually not sure if its the same issue, sure feels like it is. But in looking at it, what appears to be happening is when max cluster is hit, the redraw starts with the item at the bottom of the previous list causing the page to appear to "leap" to top. I've been playing with rows_in_block and blocks_in_cluster to see what other kind of results i get, but all I can manage to do is make it "leap" past a bunch of records. Really scratching my head on this one...

@fmp777
Copy link

fmp777 commented Jul 20, 2022

Nevermind - I had to recode the html/css of each row. While the resulting rows were all same height, there were some oddities due to some outer-element margins.

Once I simplified the per-row html/css, removing floats, margins etc, ensuring the height is unmolested by anything inside the row, the scrolling worked perfectly. Sorry for the bother!

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