Skip to content

Input binding wrongly triggers reactivity of a variable used in it's bind path computation #5156

@damooo

Description

@damooo

Describe the bug
When we bind an input to a object property, and if we use an expression to compute that property name, binding not only triggers reactivity of containing object, but also other other objects used in it's property-path computation. For example, if we say <input bind:value={form[schema.name]}>, changing input not only triggers reactivity over form object, but also on schema object used in property name computation.

And if we declare to reset form on schema change, that will be mis-triggered on value change to above binding, and effectively resets form, and binding itself again.

To Reproduce
Here is REPL. Try to input in field, and we can see reactivity mis-triggering on schema.

Expected behavior
should not trigger reactivity on other objects used in expression to compute property path.

Severity
Seems serious.

Additional context
Possibly related issues:
#4448 , #4933

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions