mirror of https://github.com/sveltejs/svelte
fix: inline style value become undefined (#8517)
fixes #8462 --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/8536/head
parent
6bbae502f6
commit
32153e318d
@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
async test({ assert, target, window }) {
|
||||||
|
const div = target.querySelector('div');
|
||||||
|
const click = new window.MouseEvent('click');
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, '<div style="background: red;"></div>');
|
||||||
|
await div.dispatchEvent(click);
|
||||||
|
await Promise.resolve();
|
||||||
|
assert.htmlEqual(target.innerHTML, '<div style=""></div>');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
let bg = "red";
|
||||||
|
|
||||||
|
const handle = () => {
|
||||||
|
bg = undefined;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div style:background={bg} on:click={handle}></div>
|
Loading…
Reference in new issue