Skip to content

Values for all bound parameters are re-evaluated when a single parameter with two-way binding is changed. #53514

Closed
@sam-wheat

Description

@sam-wheat

Steps to reproduce:

Clone this repo

Move the slider in the yellow div. Note the changed value of Config2.SomeValue is reported correctly by the control but not by the parent. This is expected as the binding is not two way.

Move the slider in the blue div. Note that ALL bound values for ALL controls are re-evaluated when the slider is moved. This behavior is not desirable and in fact appears to be incorrect since only one value is changing and only one value needs to be reported as changed. Note that bindings on People parameters on both controls are one-way and change notification is neither desired or expected. At the very least, the state of the control in the yellow div should never be affected by changes raised by the control in the blue div as the two controls are completely unrelated.

Expected / desired behavior: I would like like the parent to control (Home) to be notified of changes to Config.SomeValue without re-evaluating the People parameter and without making unnecessary calls to CreatePeople. How can I accomplish this?

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-8.0#binding-with-component-parameters

You can't implement chained binds with @Bind syntax in the child component.

I did read the above help document - I am not trying to daisy-chain, only trying to report a (single) changed value to a (single) parent control.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.area-blazorIncludes: Blazor, Razor Componentsquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions