1
0
mirror of synced 2024-11-22 04:56:08 +03:00

Fix bug where elements in select2 drop cannot be focused

This chrome workaround had the undesired side-effect of preventing anything in the select2 drop from being focused (affected single but not multi selects for some reason). Making the condition more specific to the actual problem being worked around solves this.
This commit is contained in:
colemanw 2014-12-05 17:05:59 -05:00
parent 39394e2ee8
commit a732063f1b

View File

@ -2181,7 +2181,7 @@ the specific language governing permissions and limitations under the Apache Lic
// without this the search field loses focus which is annoying
if (document.activeElement === this.body.get(0)) {
window.setTimeout(this.bind(function() {
if (this.opened()) {
if (this.opened() && this.results && this.results.length > 1) {
this.search.focus();
}
}), 0);