Fix scrol jump when select activtiies in global activities (#1907)

This commit is contained in:
aignatov-bio 2019-07-08 12:55:35 +02:00 committed by GitHub
parent 6d423ed986
commit 81aef81634
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -308,7 +308,10 @@ $.fn.extend({
var groups;
var groupChildrens;
$('.select2-selection').scrollTo(0);
$('.select2-results__options').scrollTop($(e.currentTarget).data('scrolltop'));
// Fix scroll to selected element after click
setTimeout(() => {
$('.select2-results__options').scrollTop($(e.currentTarget).data('scrolltop'));
}, 0);
if (this.dataset.singleDisplay === 'true') {
$(this).updateSingleName();
}