mirror of https://github.com/sveltejs/svelte
svelte0/svelte-15053-fix-stop-currenttime-binding-updates-during-outros
parent
221dcae8ca
commit
b2a6c0c9f9
@ -0,0 +1,13 @@
|
||||
import { flushSync } from '../../../../src/index-client.js';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
test({ target }) {
|
||||
const button = /** @type {HTMLButtonElement} */ (target.querySelector('button'));
|
||||
const audio = /** @type {HTMLAudioElement} */ (target.querySelector('audio'));
|
||||
|
||||
flushSync(() => button.click());
|
||||
audio.currentTime = 1;
|
||||
audio.dispatchEvent(new Event('timeupdate'));
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
let item = $state({ currentTime: 0 });
|
||||
</script>
|
||||
|
||||
<button onclick={() => (item = null)}>remove</button>
|
||||
|
||||
{#if item}
|
||||
<audio bind:currentTime={item.currentTime} transition:fade={{ duration: 100 }}></audio>
|
||||
{/if}
|
||||
Loading…
Reference in new issue