-
Notifications
You must be signed in to change notification settings - Fork 135
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
chore(docs): fix page-loaded class #4012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I did pull it down and test with a big image on an example and the event is firing before the image has fully loaded, but I also added this to the <head>
and as the last thing in <body>
and got the same results, so I think the change in this PR is good, though we'll have to see if we still have any issues with images loading
<script>
window.onload = function() {
console.log("window.load fired");
};
</script>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to replicate the issue here but this change looks like it should be a great fix 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Verified on a handful of examples it's firing and looks to be at the right time
Towards #4009
This PR adds extra logic to check if page has already finished loading (and if so, adds the page-loaded class) before adding window.load event listener.