Skip to content

Commit

Permalink
Use addEventListener instead of onload (#347)
Browse files Browse the repository at this point in the history
* use addEventListener instead of onload

* changeset
  • Loading branch information
Rich Harris authored Jan 27, 2021
1 parent 150d666 commit 4c0edce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-carrots-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Use addEventListener instead of onload
4 changes: 2 additions & 2 deletions packages/kit/src/api/build/css_injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default function(files) {
if (link.sheet) {
fulfil();
} else {
link.onload = function() { return fulfil() };
link.onerror = reject;
link.addEventListener('load', function() { return fulfil() });
link.addEventListener('error', reject);
}
})}));
};`.trim();
Expand Down

0 comments on commit 4c0edce

Please sign in to comment.