Skip to content

Commit 82482c2

Browse files
committed
playground: fix web component constructor NotSupportedError
1 parent 8ff2f65 commit 82482c2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/playground.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ <h1>Playground</h1>
303303
super();
304304
const shadow = this.attachShadow({ mode: 'open' });
305305
306+
const style = document.createElement('style');
307+
style.textContent = ':host{display:block;width:100%;height:100%}#editor{width:100%;height:100%}';
308+
shadow.appendChild(style);
309+
306310
// Add Monaco CSS inside the shadow root
307311
const link = document.createElement('link');
308312
link.rel = 'stylesheet';
@@ -311,9 +315,8 @@ <h1>Playground</h1>
311315
312316
// Editor host div
313317
const div = document.createElement('div');
314-
div.style.cssText = 'width:100%;height:100%';
318+
div.id = 'editor';
315319
shadow.appendChild(div);
316-
this.style.cssText = 'display:block;width:100%;height:100%';
317320
318321
link.onload = () => {
319322
monaco.editor.create(div, {

0 commit comments

Comments
 (0)