Use getAttribute when soft matching ids.
Some javascript frameworks like angular can overwrite the tag's id getter, and comparison can turn into a false negative. Newly added elements don't have the framework's code initialised yet, and calling id on those elements can differ from the id assigned via angular. Since there is no way to have frameworks initialised on the new elements, calling the id can be inconsistent. Using getAttribute("id") ensures that we always compare the html id attributes.
See this issue for more details: #130
Hey @dombesz , thanks for the PR! A couple of notes before I review:
- Don't modify the files in
dist/, we rebuild these only just before a release. - Can you get CI green? You can do a simulation locally with
npm test:ci. More details in TESTING.md
Hi @botandrose , thanks for the quick feedback, the CI should be green now.
Hi @botandrose can you please have a look at this PR?
@dombesz Hello! Thank you for your time and effort here, and sorry for the long wait on this!
The problem you pointed out turned out to be more widespread than javascript frameworks like Angular... its an issue with the DOM API itself! Take a look at #135 and #136 for more details. I expect #136 will resolve this as well, do you agree? Can you test the branch in your app to verify?
I'm going to run this branch in production on my app for the next week, and if all looks well, I'll push a bugfix release next sunday.
closing in favor of #136
Hi @botandrose , yes I believe the issue is solved by your PR as well. Thanks!
@dombesz great! I'm glad to hear that.
FYI, I've found another unrelated bug that I want to get into the next bugfix release, so contrary to what I wrote last Sunday, I expect to cut a bugfix release NEXT Sunday now.