diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index d7649897c0..8ab5d25668 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -464,9 +464,10 @@ export default function dom( } } + ${props.length > 0 && deindent` static get observedAttributes() { return ${JSON.stringify(props.map(x => x.export_name))}; - } + }`} ${body.length > 0 && body.join('\n\n')} } diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 2cb5b9e974..9f70b8ec66 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -49,10 +49,6 @@ class Component extends SvelteElement { } } } - - static get observedAttributes() { - return []; - } } customElements.define("custom-element", Component);