[render/render] Prevent activeElement.focus on SVGs, fix #1983

This commit is contained in:
Sebastian Sandqvist 2018-06-11 09:46:58 -07:00 committed by Pierre-Yves Gérardy
parent 6bf7be8887
commit 571b60830b

View file

@ -867,7 +867,7 @@ module.exports = function($window) {
updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), hooks, null, namespace === "http://www.w3.org/1999/xhtml" ? undefined : namespace)
dom.vnodes = vnodes
// 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()
if (active != null && $doc.activeElement !== active && typeof active.focus === "function") active.focus()
for (var i = 0; i < hooks.length; i++) hooks[i]()
}