From 45e4ef1223cf1e0cb3662840cda3b557c4b36f0a Mon Sep 17 00:00:00 2001 From: Mottie Date: Thu, 4 Sep 2014 11:44:13 -0500 Subject: [PATCH] Parser select - fix for IE10+ not allowing select options to be clicked --- js/parsers/parser-input-select.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/parsers/parser-input-select.js b/js/parsers/parser-input-select.js index 5e575568..6a162ab4 100644 --- a/js/parsers/parser-input-select.js +++ b/js/parsers/parser-input-select.js @@ -101,16 +101,20 @@ // this flag prevents the updateCell event from being spammed // it happens when you modify input text and hit enter var focused = false, - restoreValue = function(){ + restoreValue = function(isTbody){ // focused = false; // uncomment this line to prevent auto-accepting changes // make sure we restore original values - $(':focus').blur(); + // isTbody is needed to prevent the select from closing in IE + // see https://connect.microsoft.com/IE/feedbackdetail/view/962618/ + if (isTbody) { + $(':focus').blur(); + } return; }; // bind to .tablesorter (default class name) $(this).children('tbody') - .on('mouseleave', function(){ - restoreValue(); + .on('mouseleave', function(e){ + restoreValue(e.target.tagName === 'TBODY'); }) .on('focus', 'select, input, textarea', function(){ focused = true;