We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4371aa commit 96657a1Copy full SHA for 96657a1
1 file changed
select2.js
@@ -972,13 +972,18 @@
972
});
973
974
975
- $(window).bind(resize, function() {
976
- var s2 = $(selector);
977
- if (s2.length == 0) {
978
- $(window).unbind(resize);
979
- }
980
- s2.select2("close");
981
- });
+ window.setTimeout(function() {
+ // this is done inside a timeout because IE will sometimes fire a resize event while opening
+ // the dropdown and that causes this handler to immediately close it. this way the dropdown
+ // has a chance to fully open before we start listening to resize events
+ $(window).bind(resize, function() {
+ var s2 = $(selector);
+ if (s2.length == 0) {
982
+ $(window).unbind(resize);
983
+ }
984
+ s2.select2("close");
985
+ })
986
+ }, 10);
987
988
this.clearDropdownAlignmentPreference();
989
0 commit comments