Skip to content

Commit 3fd07ae

Browse files
committed
newlines between multi-line blocks, let the code breathe
1 parent e0aca01 commit 3fd07ae

File tree

1 file changed

+6
-0
lines changed
  • packages/svelte/src/internal/client/dom/elements/bindings

1 file changed

+6
-0
lines changed

packages/svelte/src/internal/client/dom/elements/bindings/input.js

+6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export function bind_value(input, get_value, update) {
2727
// TODO should this happen in prod too?
2828
e.bind_invalid_checkbox_value();
2929
}
30+
3031
var value = get_value();
32+
3133
// If we are hydrating and the value has since changed, then use the update value
3234
// from the input instead.
3335
if (hydrating && input.defaultValue !== input.value) {
@@ -62,6 +64,7 @@ export function bind_value(input, get_value, update) {
6264
export function bind_group(inputs, group_index, input, get_value, update) {
6365
var is_checkbox = input.getAttribute('type') === 'checkbox';
6466
var binding_group = inputs;
67+
6568
// needs to be let or related code isn't treeshaken out if it's always false
6669
let hydration_mismatch = false;
6770

@@ -127,15 +130,18 @@ export function bind_group(inputs, group_index, input, get_value, update) {
127130
queue_micro_task(() => {
128131
// necessary to maintain binding group order in all insertion scenarios. TODO optimise
129132
binding_group.sort((a, b) => (a.compareDocumentPosition(b) === 4 ? -1 : 1));
133+
130134
if (hydration_mismatch) {
131135
var value;
136+
132137
if (is_checkbox) {
133138
value = get_binding_group_value(binding_group, value, input.checked);
134139
} else {
135140
var hydration_input = binding_group.find((input) => input.checked);
136141
// @ts-ignore
137142
value = hydration_input?.__value;
138143
}
144+
139145
update(value);
140146
}
141147
});

0 commit comments

Comments
 (0)