File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,14 @@ public partial class DebouncedTextField : MudComponentBase
50
50
51
51
private readonly Timer debounceTimer = new ( ) ;
52
52
private string text = string . Empty ;
53
+ private string lastParameterText = string . Empty ;
53
54
54
55
#region Overrides of ComponentBase
55
56
56
57
protected override async Task OnInitializedAsync ( )
57
58
{
58
59
this . text = this . Text ;
60
+ this . lastParameterText = this . Text ;
59
61
this . debounceTimer . AutoReset = false ;
60
62
this . debounceTimer . Interval = this . DebounceTime . TotalMilliseconds ;
61
63
this . debounceTimer . Elapsed += ( _ , _ ) =>
@@ -68,6 +70,19 @@ protected override async Task OnInitializedAsync()
68
70
69
71
await base . OnInitializedAsync ( ) ;
70
72
}
73
+
74
+ protected override void OnParametersSet ( )
75
+ {
76
+ // Only sync when the parent's parameter actually changed since the last change:
77
+ if ( this . Text != this . lastParameterText )
78
+ {
79
+ this . text = this . Text ;
80
+ this . lastParameterText = this . Text ;
81
+
82
+ this . debounceTimer . Stop ( ) ;
83
+ this . debounceTimer . Start ( ) ;
84
+ }
85
+ }
71
86
72
87
#endregion
73
88
Original file line number Diff line number Diff line change 1
1
# v0.9.51, build 226 (2025-08-xx xx: xx UTC)
2
+ - Fixed a bug in various assistants where some text fields were not reset when resetting.
You can’t perform that action at this time.
0 commit comments