mirror of https://github.com/sveltejs/svelte
Merge b2a6c0c9f9 into 5895c637b0
commit
f80c3fe83a
@ -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