[fix] style: directive should prevent innerHTML optimization (#7390)

Fixes #7386
pull/7401/head
Pat Cavit 2 years ago committed by GitHub
parent 0eee98a50a
commit 9f4602ac6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -219,6 +219,7 @@ export default class ElementWrapper extends Wrapper {
node.classes.length > 0 ||
node.intro || node.outro ||
node.handlers.length > 0 ||
node.styles.length > 0 ||
this.node.name === 'option' ||
renderer.options.dev
) {

@ -1,6 +1,8 @@
export default {
html: `
<p style="color: red;"></p>
<div>
<p style="color: red;"></p>
</div>
`,
test({ assert, target, window }) {

@ -2,4 +2,6 @@
export let myColor = "red";
</script>
<p style:color={myColor} />
<div>
<p style:color={myColor} />
</div>

@ -4,9 +4,9 @@ export default {
`,
test({ assert, component, target, window }) {
const p = target.querySelector('div');
const div = target.querySelector('div');
const styles = window.getComputedStyle(p);
const styles = window.getComputedStyle(div);
assert.equal(styles.color, 'red');
}
};

Loading…
Cancel
Save