Replies: 1 comment 3 replies
-
In the breakfast field, the Also, https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering?view=aspnetcore-9.0 Expect the renders to be slower when using Reflection rather than default bindings. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a problem with FluentNumberField and value changes handler.
I tried many attempts to call a method after property gets assigned to to FluentNumberField, but every time the issue persist earlier or later.
The problem is that something changes a value of property even when it is set and method shall stop. And it works continuously. Handler method is being run again and again.
This is one of the examples of field definition in component and its method:
<FluentNumberField
Min="0"
Max="@meal.Duration.ToString()"
@bind-Value:get="@meal.CoveredDinners"
@bind-Value:set="(e => HandleMealPropertyChange2(meal, nameof(meal.CoveredDinners)))" />
You can find working example here: [https://github.com/ZnowuJa/TestFluentBlazorWebApp/tree/master/Components/Pages/FluentNumber] (github repo and folder)
But I tested this also with @onchange, @bind-Value:after, always getting the same result you can see on video. After change a value it it is still changing randomly within some set for instance 1-2-3-1-2-3-1-2-3 and so on and so on. Even if I comment-out my handler method the same happens.
2025-02-27_21h18_44.mp4
Sometimes I have to click just 2-3 times, sometimes I click 5 minutes before issue appears. The best method to see it quickly is to setup CPU throttling (in browsers dev tools Performance tab) to at least 6x or even 20x slowdown.
Regards
PS. I'm not 100% sure, but it looks like everything is working fine if we set HideStep="true" so user has to input number manualy.
Beta Was this translation helpful? Give feedback.
All reactions