Skip to content

Binding value in object will trigger twice updating in input[type="range"] #10823

@Rplus

Description

@Rplus

Describe the bug

There is updating issue in input[type="range"].

let object = { value: 1, };
$: console.log('update', object);

function _input(e) {
  console.log(`--- input type: ${e.target.type} ---`)
}
<input type="number" bind:value={option.value} on:input={_input} />
<input type="range" bind:value={option.value} on:input={_input} />
  1. When we change value in input[type=number]
    The console will trigger once
    image

  2. But when we change value in input[type=range]
    The console will trigger twice
    image

Thhere is something strange with input[type=range].

If we bind value directly, there is no duplicated-trigger issue.
and this issue only exists on svelte v4, svelte v5 works fine.

Reproduction

Svelte v4
https://svelte.dev/repl/1370f63ba12b4007ba975de9c935d6c0?version=4.2.12

Logs

No response

System Info



### Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions