i’m using a 3rd party scrollbar plugin (smooth-scrollbar) in my php code and it is working fine when loading page, after any livewire click or action happened (like pagination or sorting) inside a table happened suddenly the scrollbar plugin content is getting removed. Any idea what is the issue behind this. Any fix for that?
function scrollInitialize() {
var elements = document.getElementsByClassName('scroll');
for (var i = 0; i < elements.length; i++) {
var scrollbar = Scrollbar.init(elements[i], {
damping: 0.5, // Set damping to 0.5
renderByPixels: true, // Render scrollbars by pixels
continuousScrolling: true, // Enable continuous scrolling
alwaysShowTracks: true
});
}
}
function init() {
// ========================================================
// Condition based on screen width
// ========================================================
if (mq.matches) {
// ========================================================
// Smooth Scrollbar
// ========================================================
// Initialize Smooth Scrollbar for all elements with the class 'scroll'
scrollInitialize();
}
}
This is the initilization code
HTML Code:
<div class="table-responsive scroll">
<table class="cs-table table caption-top main-listing" id="dropdown-options-table"></table>
</div>