Fixed resetting bug in assistants (#535)
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
Thorsten Sommer 2025-08-15 20:07:05 +02:00 committed by GitHub
parent 28b470f40b
commit 9ca2860079
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -50,12 +50,14 @@ public partial class DebouncedTextField : MudComponentBase
private readonly Timer debounceTimer = new(); private readonly Timer debounceTimer = new();
private string text = string.Empty; private string text = string.Empty;
private string lastParameterText = string.Empty;
#region Overrides of ComponentBase #region Overrides of ComponentBase
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
this.text = this.Text; this.text = this.Text;
this.lastParameterText = this.Text;
this.debounceTimer.AutoReset = false; this.debounceTimer.AutoReset = false;
this.debounceTimer.Interval = this.DebounceTime.TotalMilliseconds; this.debounceTimer.Interval = this.DebounceTime.TotalMilliseconds;
this.debounceTimer.Elapsed += (_, _) => this.debounceTimer.Elapsed += (_, _) =>
@ -69,6 +71,19 @@ public partial class DebouncedTextField : MudComponentBase
await base.OnInitializedAsync(); await base.OnInitializedAsync();
} }
protected override void OnParametersSet()
{
// Only sync when the parent's parameter actually changed since the last change:
if (this.Text != this.lastParameterText)
{
this.text = this.Text;
this.lastParameterText = this.Text;
this.debounceTimer.Stop();
this.debounceTimer.Start();
}
}
#endregion #endregion
private void OnTextChanged(string value) private void OnTextChanged(string value)

View File

@ -1 +1,2 @@
# v0.9.51, build 226 (2025-08-xx xx:xx UTC) # v0.9.51, build 226 (2025-08-xx xx:xx UTC)
- Fixed a bug in various assistants where some text fields were not reset when resetting.