@@ -8,7 +8,6 @@ const logger = getLogger('py-register-widget');
8
8
9
9
function createWidget ( interpreter : InterpreterClient , name : string , code : string , klass : string ) {
10
10
class CustomWidget extends HTMLElement {
11
- shadow : ShadowRoot ;
12
11
wrapper : HTMLElement ;
13
12
14
13
name : string = name ;
@@ -20,11 +19,8 @@ function createWidget(interpreter: InterpreterClient, name: string, code: string
20
19
constructor ( ) {
21
20
super ( ) ;
22
21
23
- // attach shadow so we can preserve the element original innerHtml content
24
- this . shadow = this . attachShadow ( { mode : 'open' } ) ;
25
-
26
22
this . wrapper = document . createElement ( 'slot' ) ;
27
- this . shadow . appendChild ( this . wrapper ) ;
23
+ this . attachShadow ( { mode : 'open' } ) . appendChild ( this . wrapper ) ;
28
24
}
29
25
30
26
async connectedCallback ( ) {
@@ -45,7 +41,6 @@ function createWidget(interpreter: InterpreterClient, name: string, code: string
45
41
46
42
export function make_PyWidget ( interpreter : InterpreterClient ) {
47
43
class PyWidget extends HTMLElement {
48
- shadow : ShadowRoot ;
49
44
name : string ;
50
45
klass : string ;
51
46
outputElement : HTMLElement ;
@@ -58,11 +53,8 @@ export function make_PyWidget(interpreter: InterpreterClient) {
58
53
8000
constructor ( ) {
59
54
super ( ) ;
60
55
61
- // attach shadow so we can preserve the element original innerHtml content
62
- this . shadow = this . attachShadow ( { mode : 'open' } ) ;
63
-
64
56
this . wrapper = document . createElement ( 'slot' ) ;
65
- this . shadow . appendChild ( this . wrapper ) ;
57
+ this . attachShadow ( { mode : 'open' } ) . appendChild ( this . wrapper ) ;
66
58
67
59
this . addAttributes ( 'src' , 'name' , 'klass' ) ;
68
60
}
0 commit comments