Pārlūkot izejas kodu

Merge pull request #764 from socialceramics/postdestroy-dropdown-error

Adding defensive check during the document mousedown/touchend event handler.
Igor Vaynberg 12 gadi atpakaļ
vecāks
revīzija
1aa4db12d7
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -482,7 +482,7 @@ the specific language governing permissions and limitations under the Apache Lic
         $document.bind("mousedown touchend", function (e) {
             var target = $(e.target).closest("div.select2-container").get(0), attr;
             var targetDropdown = null;
-            if (target) {
+            if (target && $(target).data("select2") ) {
                 $document.find("div.select2-container-active").each(function () {
                     if (this !== target) $(this).data("select2").blur();
                 });