Fixing IE bug causing active element to be null causing render function to throw error
This commit is contained in:
parent
fa7ed079ed
commit
c2c0d40a29
2 changed files with 9 additions and 1 deletions
|
|
@ -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
|
### v1.1.3
|
||||||
|
|
||||||
#### Bug fixes:
|
#### Bug fixes:
|
||||||
|
|
|
||||||
|
|
@ -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)
|
updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === "http://www.w3.org/1999/xhtml" ? undefined : namespace)
|
||||||
dom.vnodes = vnodes
|
dom.vnodes = vnodes
|
||||||
for (var i = 0; i < hooks.length; i++) hooks[i]()
|
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}
|
return {render: render, setEventCallback: setEventCallback}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue