From 849e862413311ea2d8bad1b4c26e88230e4d9135 Mon Sep 17 00:00:00 2001 From: Jackson Nowotny Date: Tue, 22 Aug 2017 14:04:24 -0500 Subject: [PATCH] Fixing IE bug causing active element to be null causing render function to throw error --- docs/change-log.md | 1 + render/render.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/change-log.md b/docs/change-log.md index e73ff1b6..05c1e601 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -28,6 +28,7 @@ - API: `m.route.set()` causes all mount points to be redrawn ([#1592](https://github.com/MithrilJS/mithril.js/pull/1592)) - API: If a user sets the Content-Type header within a request's options, that value will be the entire header value rather than being appended to the default value ([#1924](https://github.com/MithrilJS/mithril.js/pull/1924)) - API: Using style objects in hyperscript calls will now properly diff style properties from one render to another as opposed to re-writing all element style properties every render. +- Fix IE11 active element is null causing render function to throw error. --- diff --git a/render/render.js b/render/render.js index f6782297..0a5938d6 100644 --- a/render/render.js +++ b/render/render.js @@ -630,7 +630,7 @@ 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() + if (active !== null && $doc.activeElement !== active) active.focus() } return {render: render, setEventCallback: setEventCallback}