Skip to content

Commit

Permalink
Fixes #2531 - make sure "focus" is callable before calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
mbest committed Oct 18, 2020
1 parent c41c1c3 commit cb92525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/binding/editDetection/arrayToDomNodeChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
}

// Restore the focused element if it had lost focus
if (activeElement && domNode.ownerDocument.activeElement != activeElement) {
if (activeElement && domNode.ownerDocument.activeElement != activeElement && typeof activeElement.focus === "function") {
activeElement.focus();
}

Expand Down

0 comments on commit cb92525

Please sign in to comment.