Fixed scrolling bug when closeOnSelect is false
This commit is contained in:
parent
4a363c4b30
commit
291f595a03
16
select2.js
16
select2.js
@ -1088,7 +1088,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
y = child.offset().top - results.offset().top;
|
y = child.offset().top - results.offset().top;
|
||||||
|
|
||||||
// make sure the top of the element is visible
|
// make sure the top of the element is visible
|
||||||
if (y < 0) {
|
if (y < 0 && child.css('display') != 'none' ) {
|
||||||
results.scrollTop(results.scrollTop() + y); // y is negative
|
results.scrollTop(results.scrollTop() + y); // y is negative
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2166,12 +2166,14 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
choices.each2(function (i, choice) {
|
if (this.opts.closeOnSelect){
|
||||||
if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
|
choices.each2(function (i, choice) {
|
||||||
self.highlight(0);
|
if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
|
||||||
return false;
|
self.highlight(0);
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user