diff --git a/CHANGELOG b/CHANGELOG index 89eab05..5a2cccc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Fix Event#element accessing inexistent tagName property (e.g. when element is a document). (kangax) + * Amended failing Element#identify test. * Refactor unit tests. Unit tests are now dynamically generated from a JavaScript test file and optional HTML, JS and CSS fixtures. [Tobie Langel] diff --git a/src/event.js b/src/event.js index 4d6a0ec..3691fde 100644 --- a/src/event.js +++ b/src/event.js @@ -63,7 +63,7 @@ Event.Methods = (function() { var node = event.target, type = event.type; - if (event.currentTarget) { + if (event.currentTarget && event.currentTarget.tagName) { // Firefox screws up the "click" event when moving between radio buttons // via arrow keys. It also screws up the "load" and "error" events on images, // reporting the document as the target instead of the original image.