Skip to content

Commit 1aa4db1

Browse files
committed
Merge pull request select2#764 from socialceramics/postdestroy-dropdown-error
Adding defensive check during the document mousedown/touchend event handler.
2 parents 434827d + 56631aa commit 1aa4db1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ the specific language governing permissions and limitations under the Apache Lic
482482
$document.bind("mousedown touchend", function (e) {
483483
var target = $(e.target).closest("div.select2-container").get(0), attr;
484484
var targetDropdown = null;
485-
if (target) {
485+
if (target && $(target).data("select2") ) {
486486
$document.find("div.select2-container-active").each(function () {
487487
if (this !== target) $(this).data("select2").blur();
488488
});

0 commit comments

Comments
 (0)