diff --git a/docs/change-log.md b/docs/change-log.md index 1a1ebbe2..74531135 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -10,6 +10,13 @@ --- +### v1.1.4 + +#### Bug fixes: +- Fix IE bug where active element is null causing render function to throw error. ([1943](https://github.com/MithrilJS/mithril.js/pull/1943)) + +--- + ### v1.1.3 #### Bug fixes: diff --git a/render/render.js b/render/render.js index e24a76eb..ec8acf61 100644 --- a/render/render.js +++ b/render/render.js @@ -622,7 +622,8 @@ module.exports = function($window) { updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === "http://www.w3.org/1999/xhtml" ? undefined : namespace) dom.vnodes = vnodes for (var i = 0; i < hooks.length; i++) hooks[i]() - if ($doc.activeElement !== active) active.focus() + // document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement + if (active != null && $doc.activeElement !== active) active.focus() } return {render: render, setEventCallback: setEventCallback}