KingSora / OverlayScrollbars

A javascript scrollbar plugin that hides the native scrollbars, provides custom styleable overlay scrollbars, and preserves the native functionality and feel.
https://kingsora.github.io/OverlayScrollbars
MIT License
3.71k stars 215 forks source link

Bootstrap tooltip not working when using the plugin for body tag #601

Closed TanimMahbub closed 6 months ago

TanimMahbub commented 6 months ago

First of all, awesome plugin, can't thank you and appreciate you enough, still learning it, but I can feel that it's the best for the purpose so far, because I have tried almost all of them.

Anyway, the issue is, when I added it to the body tag, the tooltips of the page stopped showing up, it's not like the markup of the tooltips is not generating, the markup is there generating just fine, but I can't see the tooltips, can't inspect either because the tooltips markup generates only when you're hovering over the trigger.

Add the Bootstrap and the OverlayScrollbars plugin to your page, Activate the BS Tooltip and activate the OverlayScrollbars plugin for the body tag and any other element if you want Now check if the Tooltip is working, you'll see it's not. Now deactivate the OverlayScrollbars plugin for the body tag and now the Tooltip is working

Expected behavior A clear and concise description of what you expected to happen.

Here is an example Check this PEN to be more clear.

Environment

KingSora commented 6 months ago

@TanimMahbub good day :)

Thank you for your kind words, really appreciate it!

I'll take a look as soon as I have time.

KingSora commented 6 months ago

@TanimMahbub I've checked it out and I'm not sure whos "fault" this exactly is, but for some reason popper is caulculating the viewport size incorrectly (might be because of their code, or because of OverlayScrollbars styles).

The fix would be to apply this styles:

html[data-overlayscrollbars] {
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
}

I've done tests whether this breaks something and it seems that everything is working fine. In case I'll continue to observer this behavior I'll implement those styles in the next release which will be v2.5.0.

TanimMahbub commented 6 months ago

Thank you so much @KingSora for the fix, it works perfectly now. I'm working on a suggestion post for the plugin and will write that as soon as possible.

KingSora commented 6 months ago

@TanimMahbub Looking forward to that! You're welcome to share the link here when the post is finished :)

TanimMahbub commented 6 months ago

I'm gonna make it as a Feature Request here, you'll see when post it.

KingSora commented 5 months ago

@TanimMahbub This workaround should not be needed anymore if you use overlayscrollbars v2.4.7 or higher :)