malihu-custom-scrollbar-plugin
malihu-custom-scrollbar-plugin copied to clipboard
Scrollbar not updating with Select2 autocomplete
Hi, I'm using the malihu scrollbar in select2 autocomplete. It's working.But when i type something in autosomplete the scrollbar changes to its default style. I'm using Aurelia JS. Could you please help to fix this. import { customAttribute, inject } from 'aurelia-framework'; import $2 from 'jquery2'; import $3 from 'jquery3';
@customAttribute('select2-searchbox') @inject(Element) export class Select2SearchboxCustomAttribute { constructor(element) { this.element = element; }
attached() {
$2(this.element).select2({
minimumInputLength: 0,
placeholder: function() {
$2(this).data('placeholder');
}
})
.on('change', (e) => {
if (!e.originalEvent) {
this.element.dispatchEvent(
new CustomEvent('change', { bubbles: true })
);
}
}).on('select2:open', function(e) {
$3('.select2-results__options').mCustomScrollbar('destroy');
setTimeout(function() {
$3('.select2-results__options').mCustomScrollbar();
}, 0);
});
}
detached() {
$2(this.element).select2('destroy');
}
}
I have the same issue but without any frameworks
I am having the same issue, already spent enough time searching for solution, I found another library nicescroll and it is working fine with select 2.