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

Virtualization #125

Closed
Citriik opened this issue Jul 2, 2019 · 7 comments
Closed

Virtualization #125

Citriik opened this issue Jul 2, 2019 · 7 comments

Comments

@Citriik
Copy link

Citriik commented Jul 2, 2019

Hello,

I've just switch from mCustomScrollbar to this really good OverlayScrollbars but I have a problem,
I need to virtualize a container because I have a lot of objects to load and it's not possible in one call. So with mCustomScrollbar this was not a problem but with OverlayScrollbars it's behaving really strangely.

Here is a JSFiddle to show you what's happening (except here it's scrolling to the bottom and in my case it's scrolling up but I don't think it matters): https://jsfiddle.net/3yzdv5up/14/

Thanks for your help :)

@KingSora
Copy link
Owner

KingSora commented Jul 2, 2019

Good day!

Since OverlayScrollbars uses the browsers native scroll functionality, and mCustomScrollbar doesn't (it changes the scroll-offset through CSS) there are fundamental differences between the plugins.

I've tested your script without any scrollbar plugin to check whether it works properly, but it turns out it acts exactly the same as if you would use OverlayScrollbars: https://jsfiddle.net/jtyhb3qn/
So it seems like your script did only work because you was using mCustomScrollbar and it wouldn't work without it. Therefore it's not really a bug of OverlayScrollbars, I hope thats logical reasoning.

I've found one small but maybe important mistake in your example:

for (let i = 0; i < total; i++) {
  elements.push($('<p>TEST<p>'));
}

You never close the p tag, instead u have two opening <p> tags. With this the browser adds more p tags than you would expect, please check it out in the developer tools. But even after I've fixed this mistake the weird scroll behavior wasn't fixed.

In the past there was already a dicussion about virtual lists (#49) and OverlayScrollbars works pretty good with HyperList, heres a example: https://jsfiddle.net/Lesgjxbn/ maybe its worth to take a look.

@Citriik
Copy link
Author

Citriik commented Jul 3, 2019

Hello,

Thank you for your answer that's exactly what I was looking for !

@KingSora
Copy link
Owner

KingSora commented Jul 3, 2019

Glad I could help!

@Citriik
Copy link
Author

Citriik commented Jul 17, 2019

Hi,

I've found an issue but I'm not sure if it's related to OverlayScrollbars or HyperList, when you scroll to the end and without stopping scrolling you scroll up the list get stuck.
Here is a JSFiddle where I managed to reproduce the issue: https://jsfiddle.net/e07r2f81/

Thanks for your help :)

edit: It's only doing this on Chrome

@Citriik Citriik reopened this Jul 17, 2019
@KingSora
Copy link
Owner

KingSora commented Jul 17, 2019

Good day @Citriik

I've replaced OverlayScrollbars in your example with a simple div so I can test wether the bug appears without the plugin... and it does. At least on my machine, you can test it here: https://jsfiddle.net/eksr695p/

So it seems its related to HyperList, but it also could be a browser issue, its hard to tell.

@Citriik
Copy link
Author

Citriik commented Jul 18, 2019

Thanks for you answer I will ask on the HyperList github page for assitance :)

@Citriik Citriik closed this as completed Jul 18, 2019
@xmsz
Copy link

xmsz commented Oct 18, 2023

HyperList太复杂了 大家有没有其他差价推荐

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

No branches or pull requests

3 participants