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

mCustomscrollbar is not working in JQuery 3.6.0 #663

Open
Praveen-raj27 opened this issue Apr 9, 2021 · 6 comments
Open

mCustomscrollbar is not working in JQuery 3.6.0 #663

Praveen-raj27 opened this issue Apr 9, 2021 · 6 comments

Comments

@Praveen-raj27
Copy link

I have updated my JQuery to latest version (3.6.0). After updating the jquery, mCustomScrollbar is not working. I also update the mCustomScrollbar to version (3.1.5). Still it is not working. The mCustomscrollbar is works fine with JQuery 3.3.1.
Can anybody helps to resolve this issue?

@thomasPierreATECNA
Copy link

this is iso to #651

i fix it like that :

function bugFix(scrollbar) {
	const draggerRail = $(scrollbar).find(".mCSB_draggerRail");
	const draggerContainer = $(scrollbar).find(".mCSB_draggerContainer");
	if (draggerRail.length > 0 && draggerRail.parent().hasClass("mCSB_dragger")) {
		draggerContainer.append(draggerRail);
	}
}

$(#my-element).mCustomScrollbar({
    axis: "y",
    theme: "dark",
    callbacks: {
        onInit: () => bugFix(this)
    }
});

@jiniC
Copy link

jiniC commented Aug 8, 2021

I have sent pr to solve this problem fundamentally : #666

@showdev
Copy link

showdev commented Oct 25, 2021

You can use jquery-migrate plugin with jQuery.UNSAFE_restoreLegacyHtmlPrefilter() or restore the functionality by extending your instance of jQuery manually;

The root cause is described here in Security Fix chapter

@codeyapmak
Copy link

codeyapmak commented Mar 15, 2022

go to jquery.mCustomScrollbar.js file and find the method _pluginMarkup, there is array scrollbar that hold the html, notice that few div's are closed like <div ..... /> so you need to replace the closing tags properly like <div .....>

@fullhugo
Copy link

fullhugo commented May 4, 2022

Yes, in _pluginMarkup replace all " />" for ">"
and in _scrollButtons replace " />" for ">" you can do this directly in minified file

@gethari
Copy link

gethari commented Aug 29, 2022

this is iso to #651

i fix it like that :

function bugFix(scrollbar) {
	const draggerRail = $(scrollbar).find(".mCSB_draggerRail");
	const draggerContainer = $(scrollbar).find(".mCSB_draggerContainer");
	if (draggerRail.length > 0 && draggerRail.parent().hasClass("mCSB_dragger")) {
		draggerContainer.append(draggerRail);
	}
}

$(#my-element).mCustomScrollbar({
    axis: "y",
    theme: "dark",
    callbacks: {
        onInit: () => bugFix(this)
    }
});

Thank you so much @thomasPierreATECNA

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

7 participants