Skip to content

Commit 618638f

Browse files
committed
untrack reads, they could be inside an effect
1 parent 1f9c9cc commit 618638f

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as e from '../../../errors.js';
55
import { is } from '../../../proxy.js';
66
import { queue_micro_task } from '../../task.js';
77
import { hydrating } from '../../hydration.js';
8-
import { is_runes } from '../../../runtime.js';
8+
import { is_runes, untrack } from '../../../runtime.js';
99

1010
/**
1111
* @param {HTMLInputElement} input
@@ -40,7 +40,7 @@ export function bind_value(input, get, set = get) {
4040
(hydrating && input.defaultValue !== input.value) ||
4141
// If defaultValue is set, then value == defaultValue
4242
// TODO Svelte 6: remove input.value check and set to empty string?
43-
(get() == null && input.value)
43+
(untrack(get) == null && input.value)
4444
) {
4545
set(is_numberlike_input(input) ? to_number(input.value) : input.value);
4646
}
@@ -189,7 +189,7 @@ export function bind_checked(input, get, set = get) {
189189
// then use the update value from the input instead.
190190
(hydrating && input.defaultChecked !== input.checked) ||
191191
// If defaultChecked is set, then checked == defaultChecked
192-
get() == null
192+
untrack(get) == null
193193
) {
194194
set(input.checked);
195195
}

0 commit comments

Comments
 (0)