1
0
mirror of synced 2025-02-04 06:09:23 +03:00

Merge pull request #2001 from arendjr/master

Don't rely on :visible and :not(..., ...) selectors which only work with Sizzle
This commit is contained in:
Kevin Brown 2014-01-20 16:48:27 -08:00
commit e559f92c35

View File

@ -272,7 +272,8 @@ the specific language governing permissions and limitations under the Apache Lic
/* make sure el received focus so we do not error out when trying to manipulate the caret. /* make sure el received focus so we do not error out when trying to manipulate the caret.
sometimes modals or others listeners may steal it after its set */ sometimes modals or others listeners may steal it after its set */
if ($el.is(":visible") && el === document.activeElement) { var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0);
if (isVisible && el === document.activeElement) {
/* after the focus is set move the caret to the end, necessary when we val() /* after the focus is set move the caret to the end, necessary when we val()
just before setting focus */ just before setting focus */
@ -1453,7 +1454,7 @@ the specific language governing permissions and limitations under the Apache Lic
// abstract // abstract
findHighlightableChoices: function() { findHighlightableChoices: function() {
return this.results.find(".select2-result-selectable:not(.select2-disabled, .select2-selected)"); return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
}, },
// abstract // abstract