Found elements are not uncached
fregante opened this issue · 5 comments
fregante commented
add element
wait for element
resolve promise
add element (different, but same selector)
wait for element
resolve promise (resolves with first element)
I'm adding a test
sindresorhus commented
Is the first element removed in this scenario, before the second call to elementReady
? Otherwise, I would say it's the correct behavior, as it always finds the first element that matches, even though it has matched before. Or am I misunderstanding?
fregante commented
The element is gone from the page but it’s still cached, so the new element is not found at all
fregante commented
However the test I added seems to succeed, so the issue may be slightly different.
My expectation is: once found, the cache should be empty. If you try RGH, you’ll find a cached selector for document
long after it was found.
sindresorhus commented
The element is gone from the page but it’s still cached
But that's not reflected in your test #13