Skip to content

Commit

Permalink
fix: still load iframe if styles fail to load
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed May 13, 2024
1 parent 106028b commit 3e56bc1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/components/AutoFrame/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ const CopyHostStyles = ({
mirror.onload = () => {
stylesLoaded = stylesLoaded + 1;

if (stylesLoaded >= elements.length) {
onStylesLoaded();
}
};
mirror.onerror = () => {
console.warn(`AutoFrame couldn't load a stylesheet`);
stylesLoaded = stylesLoaded + 1;

if (stylesLoaded >= elements.length) {
onStylesLoaded();
}
Expand Down

0 comments on commit 3e56bc1

Please sign in to comment.