Skip to content

Commit d2568aa

Browse files
committed
skip observedAttributes where appropriate - fixes #2399
1 parent 079a1ba commit d2568aa

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/compile/render-dom/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,10 @@ export default function dom(
464464
}
465465
}
466466
467+
${props.length > 0 && deindent`
467468
static get observedAttributes() {
468469
return ${JSON.stringify(props.map(x => x.export_name))};
469-
}
470+
}`}
470471
471472
${body.length > 0 && body.join('\n\n')}
472473
}

test/js/samples/css-shadow-dom-keyframes/expected.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ class Component extends SvelteElement {
4949
}
5050
}
5151
}
52-
53-
static get observedAttributes() {
54-
return [];
55-
}
5652
}
5753

5854
customElements.define("custom-element", Component);

0 commit comments

Comments
 (0)