Tuesday, September 1, 2009

[jQuery] inconsistency in closest()

I've noticed inconsistent behavior with closest(). In my use case, it
finds the expected ancestor initially. However, after a bit of DOM
manipulation, it fails to find the expected ancestor even though the
structure of DOM elements have not been modified in a way that should
cause it not to find the correct ancestor.

My contingency plan is to walk the parent() hierarchy manually. Not a
big deal, but I'd like to know if anyone else has noticed this.

Jeremy

No comments: