Skip to content

Commit 5b729c8

Browse files
committed
fix : remove cursor manipulation for input bindings
Old Fix: Restore input binding selection position (sveltejs#14649) Current Fix: Remove unnecessary cursor manipulation as the presence of runes no longer requires special handling.
1 parent 1dcced5 commit 5b729c8

File tree

1 file changed

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

1 file changed

+0
-17
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { is } from '../../../proxy.js';
77
import { queue_micro_task } from '../../task.js';
88
import { hydrating } from '../../hydration.js';
99
import { untrack } from '../../../runtime.js';
10-
import { is_runes } from '../../../context.js';
1110
import { current_batch, previous_batch } from '../../../reactivity/batch.js';
1211

1312
/**
@@ -17,7 +16,6 @@ import { current_batch, previous_batch } from '../../../reactivity/batch.js';
1716
* @returns {void}
1817
*/
1918
export function bind_value(input, get, set = get) {
20-
var runes = is_runes();
2119

2220
var batches = new WeakSet();
2321

@@ -36,21 +34,6 @@ export function bind_value(input, get, set = get) {
3634
batches.add(current_batch);
3735
}
3836

39-
// In runes mode, respect any validation in accessors (doesn't apply in legacy mode,
40-
// because we use mutable state which ensures the render effect always runs)
41-
if (runes && value !== (value = get())) {
42-
var start = input.selectionStart;
43-
var end = input.selectionEnd;
44-
45-
// the value is coerced on assignment
46-
input.value = value ?? '';
47-
48-
// Restore selection
49-
if (end !== null) {
50-
input.selectionStart = start;
51-
input.selectionEnd = Math.min(end, input.value.length);
52-
}
53-
}
5437
});
5538

5639
if (

0 commit comments

Comments
 (0)