File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
packages/svelte/tests/runtime-runes/samples/hydrate-modified-input-group Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { test } from '../../test' ;
2
+
3
+ export default test ( {
4
+ skip_mode : [ 'client' ] ,
5
+
6
+ test ( { assert, target, hydrate } ) {
7
+ const inputs = /** @type {NodeListOf<HTMLInputElement> } */ ( target . querySelectorAll ( 'input' ) ) ;
8
+ inputs [ 1 ] . checked = true ;
9
+ inputs [ 1 ] . dispatchEvent ( new window . Event ( 'change' ) ) ;
10
+ // Hydration shouldn't reset the value to 1
11
+ hydrate ( ) ;
12
+
13
+ assert . htmlEqual (
14
+ target . innerHTML ,
15
+ '<input type="radio" value="1"><input type="radio" value="2"><input type="radio" value="3">\n2'
16
+ ) ;
17
+ }
18
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <script >
2
+ let value = $state (1 );
3
+ </script >
4
+
5
+ {#each [1 , 2 , 3 ] as number }
6
+ <input type ="radio" value ={number } bind:group ={value }>
7
+ {/each }
8
+
9
+ {value }
You can’t perform that action at this time.
0 commit comments