zepto icon indicating copy to clipboard operation
zepto copied to clipboard

find api do not unique child node

Open douzi8 opened this issue 10 years ago • 2 comments

<ul>
  <li>
    <ul>
      <li>
    </ul>
  <li>
    <ul>
      <li>
    </ul>
</ul>
$('ul li').length  
$('ul').find('li').length

// Two length is not equal

douzi8 avatar Apr 28 '15 11:04 douzi8

I verified the case above, indeedly the two equivalent expressions have different values in Zepto rather than in jQuery.

jansesun avatar Apr 29 '15 03:04 jansesun

Should we filter the results of every such query to ensure that no Zepto collection ever contains the same DOM node more than once?

Similar find() problem when compared to jQuery, but with different causes: https://github.com/madrobby/zepto/issues/730

mislav avatar Mar 30 '16 08:03 mislav