sindresorhus/element-ready

Found elements are not uncached

fregante opened this issue · 5 comments

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

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?

The element is gone from the page but it’s still cached, so the new element is not found at all

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.

The element is gone from the page but it’s still cached

But that's not reflected in your test #13

But that's not reflected in your test #13

Yeah :P

However the test I added seems to succeed

I have to look into RGH further