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

Incorrect dragger height #364

Open
muktupavels opened this issue Oct 28, 2015 · 3 comments · May be fixed by #366
Open

Incorrect dragger height #364

muktupavels opened this issue Oct 28, 2015 · 3 comments · May be fixed by #366

Comments

@muktupavels
Copy link
Contributor

I have set alwaysShowScrollbar to 2. When there is no enough content I expect to see mCSB_dragger in full height, but currently there is extra 10px space.

In _setDraggerLength (line 952) max-height is set to parent height - 10. Removing '-10' fixes problem... Why '-10' was added and can it be safely removed?

@malihu
Copy link
Owner

malihu commented Oct 29, 2015

You can remove it if you want.
I've set this limit simply to give a "visual" hint that there's overflowed content when content is barely longer than the container (e.g. when there's 2-3 pixels overflow you can't really see the scrollbar moving due to animation inertia/easing).
Anyway, you can safely remove it (esp. since you always show it).

There's also another way you could do it (I haven't tested it but it should work), without editing the script. You could remove the dragger css max-height value on onOverflowYNone callback, for example:

$(selector).mCustomScrollbar({
    callbacks:{
        onOverflowYNone:function(){
            $(this).find(".mCSB_dragger").css("max-height","none");
        }
    }
});

@muktupavels
Copy link
Contributor Author

That will not work since height is calculated bigger then .mCB_draggerContainer. I created pull request that fixes bigger height problem and also my initial problem.

@lupikas
Copy link

lupikas commented May 21, 2021

I have same problem with width. How can I fix it?

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