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

fix: stylesheet loading #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

benjaminrobinet
Copy link

@benjaminrobinet benjaminrobinet commented Nov 13, 2024

Description

This PR aims to fix the loading of Stylesheets.
Currently they are cloned before inserted to the current page, but the one that is awaited to be loaded is not the cloned one. So it never loads.
I am fixing this by returning the newly cloned one.

It also fix the infinite loop / memory leak in the waitForStylesheet function that occurs when the provided timeout is elapsed and the stylesheet never loads.

Checks

  • The PR is submitted to the master branch
  • The code was linted before pushing (npm run lint)
  • All tests are passing (npm run test)
  • New or updated tests are included
  • The documentation was updated as required

@benjaminrobinet benjaminrobinet marked this pull request as ready for review November 13, 2024 18:13
@benjaminrobinet
Copy link
Author

Special thanks to @Nam-Hai for helping me on this.

@daun
Copy link
Member

daun commented Nov 14, 2024

Welcome and thanks for contributing. This looks great! Never realized this was broken in the first place. Tests are passing, but I'll give this a try in our playground and report back.

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 this pull request may close these issues.

2 participants