ant-design-blazor / ant-design-blazor

🌈A set of enterprise-class UI components based on Ant Design and Blazor.

Home Page:https://antblazor.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InputNumber: unable to invoke event-callback "OnChange"

Abin-Liu opened this issue · comments

Describe the bug

I'm using the InputNumber component in a project and want to be notified when the user changed its value, I tried to use the OnChange event-callback and got no luck.

Here's the demo code:
code

This is the error:
error

I also tried to use "ValueChanged" got same error, and there seems no other events can serve this purpose.

Thanks for contacting us @Abin-Liu , please specific the TValue="int"

Thanks for contacting us @Abin-Liu , please specific the TValue="int"

Did that already, no luck.

Thanks for contacting us @Abin-Liu , please specific the TValue="int"

Oops, I must missed something before, I specified TValue as you said and it worked this time, so it's my bad, sorry about the trouble.

@Abin-Liu by the way, I see you use @bind-Value="@MyValue". please check official blazor docs, you should use @bind-Value="MyValue" without second @. I would recommend this article - https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-8.0

Thank you @GoldSucc .