dotnet/AspNetCore.Docs

Blazor bind:after description is incorrect on the "Blazor Data binding" page.

willdean opened this issue ยท 6 comments

Description

The description of how to use bind:after contains the following text:

To execute asynchronous logic after binding, use @bind:after="{EVENT}" with a DOM event for the {EVENT} placeholder. An assigned C# method isn't executed until the bound value is assigned synchronously.

I think this contains a (very confusing, IMO) cut-and-paste error from the earlier code about bind:event, which (correctly) reads:

Bind a property or field on other DOM events by including an @Bind:event="{EVENT}" attribute with a DOM event for the {EVENT} placeholder.

But the @bind:after attribute does not have a value which which is a DOM event. It has a value that's the name of a method (or delegate) to be called after the event has occurred. It should probably read something more like like:

To execute asynchronous logic after binding, use @bind:after="{DELEGATE}" . An assigned C# method [perhaps this should read "delegate" instead?] isn't executed until the bound value is assigned synchronously.

This problem was there in the 8.0 docs (maybe earlier) and is still in the 10-preview docs.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-9.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

Related Issues

๐Ÿ‚๐ŸŽƒ๐Ÿฎ Autumn Skies and Pumpkin Pies! ๐Ÿฅงโ˜•๐Ÿ‚

Stand by! A green dinosaur ๐Ÿฆ– will arrive shortly to assist.

Yes, I see what you mean. I'll take your suggestion on this and try to get a PR up by EOD to resolve it. Thanks for calling it out.

Actually! I have a minute ... but only a minute ๐Ÿ˜† ... to address this. I'll place your suggestion now for review with the product unit.

If I'd known you were going to fix it in two minutes I wouldn't have waited a year or so to file the bug...

You're the first person to ask, and we've had several C# gurus look at this, including our own product unit pros.

Nasty gremlins ๐Ÿ˜ˆ still get by us, but we'll squash them as fast as we can.

You're the first person to ask, and we've had several C# gurus look at this, including our own product unit pros.

I've actually met the original Blazor team, so you're not going to impress me like that. They may be super-human, but only slightly.