Skip to content

Misleading example for the chained bind concept #33896

@ShahryarSaljoughi

Description

@ShahryarSaljoughi

Description

In the second example of this section(PasswordEntry example), the two-way binding syntax is used within the parent component. which implies the fact that the author meant to have two-way binding. However the underlying component (PasswordEntry) does not have sufficient setup for supporting two-way binding.

In the current example, the PasswordEntry component binds its input element’s value to a private password field, which is only updated when the input event occurs (OnPasswordChanged). This setup does not automatically reflect changes made to the password field in the parent component (PasswordBinding) in the child component’s input element.

I suppose we should have some mechanism for reflecting the new values flowing down to the PasswordEntry component. (using OnParametersSet or updating the value of "password" within the setter of Password property).

Page URL

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

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/data-binding.md

Document ID

3f912dfc-5ba5-6c6c-ba93-1ae78508a5cc

Article author

@guardrex

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions