Better fix for IE9 issue with document.activeElement error (#1489008)