diff --git a/CHANGELOG b/CHANGELOG index a869c4b..fe6572d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395. [Mislav Marohnić, Tobie Langel] + * Element.setOpacity now calls removeAttribute on the filter style on IE if no more filters remain, which makes Cleartype work properly. Closes #8376. [alexdemi, Thomas Fuchs] * Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name). [Tobie Langel] diff --git a/src/event.js b/src/event.js index 499a239..e1a3ea9 100644 --- a/src/event.js +++ b/src/event.js @@ -47,7 +47,8 @@ Object.extend(Event, { }, findElement: function(event, expression) { - return Event.element(event).up(expression); + var element = Event.element(event); + return element.match(expression) ? element : element.up(expression); }, observers: false,