Created
June 9, 2022 23:28
-
-
Save nolanlawson/a8cb14999393916ab4a8c3af74fd4221 to your computer and use it in GitHub Desktop.
Repro Chrome whenDefined issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Repro Chrome whenDefined issue</title> | |
</head> | |
<body> | |
<h1>Repro Chrome whenDefined issue</h1> | |
<pre id="display"></pre> | |
<script> | |
customElements.define('x-foo', class MyElement extends HTMLElement {}) | |
customElements.whenDefined('x-foo').then(Ctor => { | |
display.innerHTML = `Constructor: ${Ctor}` | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment