malihu / malihu-custom-scrollbar-plugin

Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
http://manos.malihu.gr/jquery-custom-content-scroller
MIT License
4.11k stars 1.51k forks source link

Fix self-closing tags used in normal element #666

Open jiniC opened 2 years ago

jiniC commented 2 years ago

After updating the jQuery to to latest version (3.6.0), mCustomScrollbar is not working. Errors caused by jQuery updates have already been discussed several times in the issue. This is one of those issues : https://github.com/malihu/malihu-custom-scrollbar-plugin/issues/663

I found that this problem was caused by self-closing tags used in normal element and fixed it.

According to the HTML5 spec, tags that cannot have any contents (known as void elements) can be self-closing*.

Self-closing tags on non-void elements like <div/>, <a/> which I found in this library will not work at all. The trailing slash will be ignored, and these will be treated as opening tags. This is likely to lead to nesting problems. In fact, this is already causing problems. jQuery corrected this automatically in the previous version, but the latest version does not catch it, so an error is occurring.