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

[2.0.1] Native scrollbar is flashed when the view first starts overflowing #46

Closed
Tarpsvo opened this issue Dec 22, 2016 · 7 comments
Closed

Comments

@Tarpsvo
Copy link

Tarpsvo commented Dec 22, 2016

Simplebar 2.0.1. Chrome 55. Windows 10.

When a view goes from not needing a scrollbar to needing a scrollbar, the native scrollbar will flash for a brief moment of time. Probably due to debouncing and/or initialization times.

I wonder if there are any ways to avoid the flashing?

@Grsmto
Copy link
Owner

Grsmto commented Dec 22, 2016

Hi,
I can't reproduce this issue on my testing page. How can I reproduce?
The debounce shouldn't be the problem as we are using the leading option (so calculation got called immediately anyway, only subsequent calls are debounced).

@Tarpsvo
Copy link
Author

Tarpsvo commented Dec 22, 2016

Hey!

I tried to create a test to reproduce the issue, but failed to create a minimalistic example.

I think the scroll was flashing due to the complexity of my view rendering - it added a lot of things to the browser main queue and by the time the queue got to the SimpleBar, the browser had already decided to render the default scrollbar.

I cannot give you a reproducible testcase right now, sorry. I'll look into it a bit more on my own for now, Currently it seems it's entirely my fault. 😐

Great library, thank you for your efforts!

@Tarpsvo Tarpsvo closed this as completed Dec 22, 2016
@Grsmto
Copy link
Owner

Grsmto commented Dec 22, 2016

Ok thanks for this. I hope it's not caused by the Mutation Observer, I didn't test it in situation with a big DOM and lot of manipulations.
If you come back with some performances issues I'll try to take a look at that as it may be concerning.

@Tarpsvo
Copy link
Author

Tarpsvo commented Dec 22, 2016

While trying to create a testcase to replicate the issue at hand, I ran across another issue: scrollbar slider position calculations. In scrollable areas with extremely long content, the scrollbar slider position seems to be calculated a bit wrong, causing the native scrollbar to appear as well.

See the fiddle below. Scroll to the bottom to see the issue. (Windows 10, Chrome 55, Simplebar 2.0.1).

https://gist.run/?id=1b4a0c88d0a5772ef26248ca22e87a2e

@Grsmto
Copy link
Owner

Grsmto commented Dec 22, 2016

Oh that's a weird one!
Apparently it's happening no matter the number of item, when you reach the end of the list!

Ok got it, it's a miscalculation of the height, it doesn't take the padding into account. Thanks for this!

@Tarpsvo
Copy link
Author

Tarpsvo commented Dec 22, 2016

Hmm, true. Could be related to the fact that it is a fragment inside an iframe, not in an actual website.

@Grsmto
Copy link
Owner

Grsmto commented Jan 7, 2017

Fixed in 45abdcb

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

2 participants