Skip to content

Commit 2b5bcbe

Browse files
committed
revert: 移除更改
1 parent 44b98e9 commit 2b5bcbe

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,6 @@ public partial class AutoComplete
9292
[NotNull]
9393
private AutoCompleteItems? _dropdown = default;
9494

95-
/// <summary>
96-
/// Tracks the current user input to prevent it from being overwritten
97-
/// </summary>
98-
private string _currentUserInput = string.Empty;
99-
100-
/// <summary>
101-
/// Flag to track whether we're handling debounced filtering
102-
/// </summary>
103-
private bool _isFiltering = false;
104-
10595
/// <summary>
10696
/// <inheritdoc/>
10797
/// </summary>
@@ -125,12 +115,6 @@ protected override void OnParametersSet()
125115
LoadingIcon ??= IconTheme.GetIconByKey(ComponentIcons.LoadingIcon);
126116

127117
Items ??= [];
128-
129-
// Initialize _currentUserInput with current value if it hasn't been set yet
130-
if (string.IsNullOrEmpty(_currentUserInput) && !string.IsNullOrEmpty(CurrentValueAsString))
131-
{
132-
_currentUserInput = CurrentValueAsString;
133-
}
134118
}
135119

136120
private bool _render = true;
@@ -146,8 +130,6 @@ protected override void OnParametersSet()
146130
/// </summary>
147131
private async Task OnClickItem(string val)
148132
{
149-
// Update both the CurrentValue and _currentUserInput when an item is clicked
150-
_currentUserInput = val;
151133
CurrentValue = val;
152134

153135
if (OnSelectedItemChanged != null)
@@ -183,10 +165,10 @@ public override async Task TriggerFilter(string val)
183165
_filterItems = [.. items];
184166
}
185167

186-
if (DisplayCount != null)
187-
{
188-
_filterItems = [.. _filterItems.Take(DisplayCount.Value)];
189-
}
168+
if (DisplayCount != null)
169+
{
170+
_filterItems = [.. _filterItems.Take(DisplayCount.Value)];
171+
}
190172

191173
await TriggerChange(val);
192174
}

0 commit comments

Comments
 (0)