Defend against jQuery-wrapped targets in keydownEvent spec helper

This commit is contained in:
Nathan Sobo
2014-03-14 14:46:56 -06:00
parent ae324c13a6
commit 067f73da38

View File

@@ -187,7 +187,7 @@ window.keydownEvent = (key, properties={}) ->
nativeProperties.alt = properties.altKey
nativeProperties.shift = properties.shiftKey
nativeProperties.cmd = properties.metaKey
nativeProperties.target = properties.target
nativeProperties.target = properties.target?[0] ? properties.target
nativeProperties.which = properties.which
originalEvent = nativeKeydownEvent(key, nativeProperties)
properties = $.extend({originalEvent}, properties)