@@ -27,7 +27,9 @@ export function bind_value(input, get_value, update) {
27
27
// TODO should this happen in prod too?
28
28
e . bind_invalid_checkbox_value ( ) ;
29
29
}
30
+
30
31
var value = get_value ( ) ;
32
+
31
33
// If we are hydrating and the value has since changed, then use the update value
32
34
// from the input instead.
33
35
if ( hydrating && input . defaultValue !== input . value ) {
@@ -62,6 +64,7 @@ export function bind_value(input, get_value, update) {
62
64
export function bind_group ( inputs , group_index , input , get_value , update ) {
63
65
var is_checkbox = input . getAttribute ( 'type' ) === 'checkbox' ;
64
66
var binding_group = inputs ;
67
+
65
68
// needs to be let or related code isn't treeshaken out if it's always false
66
69
let hydration_mismatch = false ;
67
70
@@ -127,15 +130,18 @@ export function bind_group(inputs, group_index, input, get_value, update) {
127
130
queue_micro_task ( ( ) => {
128
131
// necessary to maintain binding group order in all insertion scenarios. TODO optimise
129
132
binding_group . sort ( ( a , b ) => ( a . compareDocumentPosition ( b ) === 4 ? - 1 : 1 ) ) ;
133
+
130
134
if ( hydration_mismatch ) {
131
135
var value ;
136
+
132
137
if ( is_checkbox ) {
133
138
value = get_binding_group_value ( binding_group , value , input . checked ) ;
134
139
} else {
135
140
var hydration_input = binding_group . find ( ( input ) => input . checked ) ;
136
141
// @ts -ignore
137
142
value = hydration_input ?. __value ;
138
143
}
144
+
139
145
update ( value ) ;
140
146
}
141
147
} ) ;
0 commit comments