Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Input] NotifyFieldChanged is called twice for all FluentInputBase derived components #1846

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6288,7 +6288,7 @@
<summary>
Optionally supplies a template for rendering the pagination summary.
The following values can be included:
{your State parameter name}.CurrentPageIndex (zero-basedd, so +1 for the current page number)
{your State parameter name}.CurrentPageIndex (zero-based, so +1 for the current page number)
{your State parameter name}.LastPageIndex (zero-based, so +1 for the total number of pages)
</summary>
</member>
Expand Down
4 changes: 3 additions & 1 deletion src/Core/Components/Base/FluentInputBaseHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ public partial class FluentInputBase<TValue>
/// <returns></returns>
protected virtual async Task ChangeHandlerAsync(ChangeEventArgs e)
{
var _notifyCalled = false;
var isValid = TryParseValueFromString(e.Value?.ToString(), out TValue? result, out var validationErrorMessage);

if (isValid)
{
await SetCurrentValueAsync(result ?? default);
_notifyCalled = true;
}
else
{
Expand All @@ -43,7 +45,7 @@ protected virtual async Task ChangeHandlerAsync(ChangeEventArgs e)
_parsingValidationMessages.Add(FieldIdentifier, validationErrorMessage ?? "Unknown parsing error");
}
}
if (FieldBound)
if (FieldBound && !_notifyCalled)
{
CascadedEditContext?.NotifyFieldChanged(FieldIdentifier);
}
Expand Down
Loading