Closed AugV closed 2 years ago
I think this is probably an issue of not first checking if the query exists in the light dom. I added this as a test case and will see if I can get it fixed.
Confirmed. Wrapping the calls in [...new Set(...)]
works. I added a test case as well.
https://github.com/KonnorRogers/shadow-dom-testing-library/pull/11
v1.1.8 should have the fix. Let me know if that works for you.
Hi, first of all want to thank you for a great work, this library is something we've been looking for a long time. Now to the topic, it seems that shadow queries are returning duplicate nodes for the same result in some cases. Created a little sandbox to illustrate the issue. This example uses lightDOM, but I have the same problems with web components and shadowDOM.
I saw that you're creating a
Set
from results indeepQuerySelectorAll()
to remove the duplicates, doing the same solution and returning the Set fromqueryAllByShadow...()
methods would solve the issue in question, I believe, unless I'm missing something.Hopefully that's enough of information, if not, I'll be happy to provide with more :) thanks again.