Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes it can't capture the matching elements with stopOnDomReady=true #27

Closed
riophae opened this issue Sep 3, 2019 · 0 comments · Fixed by #28
Closed

Sometimes it can't capture the matching elements with stopOnDomReady=true #27

riophae opened this issue Sep 3, 2019 · 0 comments · Fixed by #28

Comments

@riophae
Copy link
Contributor

riophae commented Sep 3, 2019

Demo: https://riophae.github.io/element-ready-bug-reproduction/
You can find the source code at https://github.com/riophae/element-ready-bug-reproduction

image

You see elementReady('#target') can't find the div#target element that it should do. This is repeatable on Chrome 76, Firefox 68 & Edge 18. The OS is Windows 10 x64 1903.
I have also included the fixed version for comparison.

The reason behind this is, the div#target element is placed near </html>. Before element-ready spots it, dom-loaded has cancelled requestAnimationFrame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant