aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/dom_utils.coffee1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index 7f18e643..553287af 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -171,6 +171,7 @@ DomUtils =
# An unknown type will be treated the same as "text", in the same way that the browser does.
#
isSelectable: (element) ->
+ return false unless element instanceof Element
unselectableTypes = ["button", "checkbox", "color", "file", "hidden", "image", "radio", "reset", "submit"]
(element.nodeName.toLowerCase() == "input" && unselectableTypes.indexOf(element.type) == -1) ||
element.nodeName.toLowerCase() == "textarea" || element.isContentEditable