From 5b729c83c1b0bb55f7281f9fb0e001ea4be4db6a Mon Sep 17 00:00:00 2001 From: Hariharan Srinivasan Date: Wed, 20 Aug 2025 00:20:18 +0100 Subject: [PATCH] fix : remove cursor manipulation for input bindings Old Fix: Restore input binding selection position (#14649) Current Fix: Remove unnecessary cursor manipulation as the presence of runes no longer requires special handling. --- .../client/dom/elements/bindings/input.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/elements/bindings/input.js b/packages/svelte/src/internal/client/dom/elements/bindings/input.js index 67e6ff1dd2..ccb7ed29e3 100644 --- a/packages/svelte/src/internal/client/dom/elements/bindings/input.js +++ b/packages/svelte/src/internal/client/dom/elements/bindings/input.js @@ -7,7 +7,6 @@ import { is } from '../../../proxy.js'; import { queue_micro_task } from '../../task.js'; import { hydrating } from '../../hydration.js'; import { untrack } from '../../../runtime.js'; -import { is_runes } from '../../../context.js'; import { current_batch, previous_batch } from '../../../reactivity/batch.js'; /** @@ -17,7 +16,6 @@ import { current_batch, previous_batch } from '../../../reactivity/batch.js'; * @returns {void} */ export function bind_value(input, get, set = get) { - var runes = is_runes(); var batches = new WeakSet(); @@ -36,21 +34,6 @@ export function bind_value(input, get, set = get) { batches.add(current_batch); } - // In runes mode, respect any validation in accessors (doesn't apply in legacy mode, - // because we use mutable state which ensures the render effect always runs) - if (runes && value !== (value = get())) { - var start = input.selectionStart; - var end = input.selectionEnd; - - // the value is coerced on assignment - input.value = value ?? ''; - - // Restore selection - if (end !== null) { - input.selectionStart = start; - input.selectionEnd = Math.min(end, input.value.length); - } - } }); if (