From 84bea357c879090a833b096c00be5c4318d48c4f Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 5 Apr 2016 06:50:06 +0100 Subject: Check for document.activeElement. When DomUtils.isFocusable() is called from GrabBackFocus-pushState-monitor it is possible that document.activeElement is not ready. So we should check. Here, we check in DomUtils.isFocusable(), because we always need element to be defined for this test, not just in GrabBackFocus-pushState-monitor. --- lib/dom_utils.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 9a6c1b09..a57cbedb 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -192,7 +192,7 @@ DomUtils = element.nodeName?.toLowerCase() in ["embed", "object"] isFocusable: (element) -> - @isEditable(element) or @isEmbed element + element and (@isEditable(element) or @isEmbed element) isDOMDescendant: (parent, child) -> node = child -- cgit v1.2.3