|
|
@ -76,14 +76,19 @@ export function bind_value(input, get, set = get) {
|
|
|
|
|
|
|
|
|
|
|
|
var value = get();
|
|
|
|
var value = get();
|
|
|
|
|
|
|
|
|
|
|
|
if (input === document.activeElement && batches.has(/** @type {Batch} */ (previous_batch))) {
|
|
|
|
if (input === document.activeElement) {
|
|
|
|
|
|
|
|
// we need both, because in non-async mode, render effects run before previous_batch is set
|
|
|
|
|
|
|
|
var batch = /** @type {Batch} */ (previous_batch ?? current_batch);
|
|
|
|
|
|
|
|
|
|
|
|
// Never rewrite the contents of a focused input. We can get here if, for example,
|
|
|
|
// Never rewrite the contents of a focused input. We can get here if, for example,
|
|
|
|
// an update is deferred because of async work depending on the input:
|
|
|
|
// an update is deferred because of async work depending on the input:
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// <input bind:value={query}>
|
|
|
|
// <input bind:value={query}>
|
|
|
|
// <p>{await find(query)}</p>
|
|
|
|
// <p>{await find(query)}</p>
|
|
|
|
|
|
|
|
if (batches.has(batch)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (is_numberlike_input(input) && value === to_number(input.value)) {
|
|
|
|
if (is_numberlike_input(input) && value === to_number(input.value)) {
|
|
|
|
// handles 0 vs 00 case (see https://github.com/sveltejs/svelte/issues/9959)
|
|
|
|
// handles 0 vs 00 case (see https://github.com/sveltejs/svelte/issues/9959)
|
|
|
|