Closed marzelin closed 5 years ago
yeach selecting collections doesn't work in a way specified in docs
I just replicated above requirement it is working fine able to extract exactly as explained.
this issue can be closed
@JinnaBalu The selector: x('ul', ['li'])
should only return items from the first list (["1-1", "1-2", "1-3"]
). The result you've got is all items from all lists. The selector that should return all items from all lists is x(['ul'], ['li'])
.
I ran into this issue too 😬
The behavior you want would require you to explicitly to use :nth-of-type(1). By using the array is going to give you all matches.
Subject of the issue
Retrieving collections doesn't work as described in docs
Your environment
reproduction here: https://runkit.com/marzelin/x-ray-bug
given this example:
per docs
x('ul', ['li'])
should select all items in the first list but it selects all items in all lists. Also, per docsx(['ul'], ['li'])
should return all items in all lists, but it returns nothing.