pull/14349/head
Rich Harris 2 years ago
parent 702b93337e
commit 6b32f007d7

@ -0,0 +1,17 @@
import { flushSync } from 'svelte';
import { test } from '../../test';
export default test({
skip_mode: ['client'],
test({ assert, target, hydrate }) {
const input = /** @type {HTMLInputElement} */ (target.querySelector('input'));
input.value = '1';
input.dispatchEvent(new window.Event('input'));
// Hydration shouldn't reset the value to empty
hydrate();
flushSync();
assert.htmlEqual(target.innerHTML, '<input type="number">\n1 (number)');
}
});

@ -0,0 +1,6 @@
<script>
let value = $state(0);
</script>
<input type="number" bind:value={value}>
{value} ({typeof value})
Loading…
Cancel
Save