Skip to content

Commit

Permalink
Merge pull request #26 from databox/bugfix/scroll-disabled-after-sele…
Browse files Browse the repository at this point in the history
…cting-in-modal

Bugfix/Scroll disabled after selecting in modal
  • Loading branch information
jureznidarec authored Jul 17, 2020
2 parents a1fd7bf + 1b2704f commit f001ba7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion dist/js/select2.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -4748,9 +4748,12 @@ S2.define('select2/dropdown/attachBody',[
});
});

// Similar issue described in https://github.com/select2/select2/issues/4236
$watchers.on(scrollEvent, function (ev) {
var position = Utils.GetData(this, 'select2-scroll-position');
$(this).scrollTop(position.y);
if ($(this).find('.select2-container--open').length) {
$(this).scrollTop(position.y);
}
});

$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.full.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion dist/js/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4748,9 +4748,12 @@ S2.define('select2/dropdown/attachBody',[
});
});

// Similar issue described in https://github.com/select2/select2/issues/4236
$watchers.on(scrollEvent, function (ev) {
var position = Utils.GetData(this, 'select2-scroll-position');
$(this).scrollTop(position.y);
if ($(this).find('.select2-container--open').length) {
$(this).scrollTop(position.y);
}
});

$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/js/select2/dropdown/attachBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ define([
});
});

// Similar issue described in https://github.com/select2/select2/issues/4236
$watchers.on(scrollEvent, function (ev) {
var position = Utils.GetData(this, 'select2-scroll-position');
$(this).scrollTop(position.y);
if ($(this).find('.select2-container--open').length) {
$(this).scrollTop(position.y);
}
});

$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
Expand Down

0 comments on commit f001ba7

Please sign in to comment.