Skip to content

Commit

Permalink
[Input] NotifyFieldChanged is called twice for all FluentInputBase de…
Browse files Browse the repository at this point in the history
…rived components (#1846)
  • Loading branch information
vnbaaij committed Apr 29, 2024
1 parent 9201367 commit 7f7e350
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Core/Components/Base/FluentInputBaseHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public partial class FluentInputBase<TValue>
public bool Immediate { get; set; } = false;

/// <summary>
/// Delay, in milliseconds, before to raise the <see cref="ValueChanged"/> event.
/// Gets or sets the delay, in milliseconds, before to raise the <see cref="ValueChanged"/> event.
/// </summary>
[Parameter]
public int ImmediateDelay { get; set; } = 0;
Expand All @@ -32,7 +32,7 @@ protected virtual async Task ChangeHandlerAsync(ChangeEventArgs e)

if (isValid)
{
await SetCurrentValue(result ?? default);
await SetCurrentValueAsync(result ?? default);
_notifyCalled = true;
}
else
Expand Down Expand Up @@ -61,13 +61,13 @@ protected virtual async Task InputHandlerAsync(ChangeEventArgs e) // TODO: To up
if (this.Immediate)
{
// Raise ChangeHandler after a delay
if (this.ImmediateDelay > 0)
if (ImmediateDelay > 0)
{
_timerForImmediate = GetNewPeriodicTimer(this.ImmediateDelay);
_timerForImmediate = GetNewPeriodicTimer(ImmediateDelay);

while (await _timerForImmediate.WaitForNextTickAsync(_timerCancellationTokenSource.Token))
{
await this.ChangeHandlerAsync(e);
await ChangeHandlerAsync(e);
_timerCancellationTokenSource.Cancel();
}
}
Expand Down

0 comments on commit 7f7e350

Please sign in to comment.