File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/BootstrapBlazor/Components/Search Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ public partial class Search<TValue>
146146 /// Gets or sets the event callback when the clear button is clicked. Default is null.
147147 /// </summary>
148148 [ Parameter ]
149- public Func < string ? , Task > ? OnClear { get ; set ; }
149+ public Func < Task > ? OnClear { get ; set ; }
150150
151151 [ Inject ]
152152 [ NotNull ]
@@ -221,18 +221,17 @@ private async Task OnSearchClick()
221221 {
222222 await InvokeVoidAsync ( "showList" , Id ) ;
223223 }
224- StateHasChanged ( ) ;
225224 }
226225 }
227226
228227 private async Task OnClearClick ( )
229228 {
229+ _displayText = "" ;
230230 if ( OnClear != null )
231231 {
232- await OnClear ( _displayText ) ;
232+ await OnClear ( ) ;
233233 }
234- _displayText = "" ;
235- _filterItems = [ ] ;
234+ await OnSearchClick ( ) ;
236235 }
237236
238237 private string ? GetDisplayText ( TValue item )
@@ -272,6 +271,7 @@ public async Task TriggerFilter(string val)
272271 if ( IsTriggerSearchByInput )
273272 {
274273 await OnSearchClick ( ) ;
274+ StateHasChanged ( ) ;
275275 }
276276 _dropdown . Render ( ) ;
277277 }
You can’t perform that action at this time.
0 commit comments