File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
CodeBeam.MudBlazor.Extensions/Components/ListExtended Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 3232 {
3333 <MudCheckBox CheckedIcon =" @SelectAllCheckBoxIcon" Color =" @Color" @bind-Checked =" _allSelected" @onclick =" () => SelectAllItems(_allSelected)" Dense =" true" />
3434 }
35- <MudTextField @bind-Value =" @_searchString" Class =" @ClassSearchBox" Placeholder =" @SearchBoxPlaceholder" OnKeyUp =" @(() => UpdateSelectedStyles())" Immediate =" true" Variant =" Variant.Outlined" Margin =" Margin.Dense"
35+ <MudTextField @ref = " _searchField " @ bind-Value =" @_searchString" Class =" @ClassSearchBox" Placeholder =" @SearchBoxPlaceholder" OnKeyDown = " SearchBoxHandleKeyDown " OnKeyUp =" @(() => UpdateSelectedStyles())" Immediate =" true" Variant =" Variant.Outlined" Margin =" Margin.Dense"
3636 Adornment =" Adornment.End" AdornmentIcon =" @Icons.Material.Filled.Search" AdornmentColor =" Color" AutoFocus =" @SearchBoxAutoFocus" />
3737 </div >
3838 </MudListSubheaderExtended >
Original file line number Diff line number Diff line change @@ -781,6 +781,22 @@ protected internal void Unregister(MudListExtended<T> child)
781781
782782 #region Events (Key, Focus)
783783
784+ protected internal async Task SearchBoxHandleKeyDown ( KeyboardEventArgs obj )
785+ {
786+ if ( Disabled || ( ! Clickable && ! MultiSelection ) )
787+ return ;
788+ switch ( obj . Key )
789+ {
790+ case " " :
791+ _searchString = _searchString + " " ;
792+ await _searchField . BlurAsync ( ) ;
793+ await _searchField . FocusAsync ( ) ;
794+ StateHasChanged ( ) ;
795+ break ;
796+ }
797+ }
798+
799+ MudTextField < string > _searchField ;
784800 protected internal async Task HandleKeyDown ( KeyboardEventArgs obj )
785801 {
786802 if ( Disabled || ( ! Clickable && ! MultiSelection ) )
@@ -1365,8 +1381,8 @@ public async Task ForceUpdate()
13651381 }
13661382
13671383 protected async Task OnDoubleClickHandler ( MouseEventArgs args , T itemValue )
1368- {
1369- await OnDoubleClick . InvokeAsync ( new ListItemClickEventArgs < T > ( ) { MouseEventArgs = args , ItemValue = itemValue } ) ;
1384+ {
1385+ await OnDoubleClick . InvokeAsync ( new ListItemClickEventArgs < T > ( ) { MouseEventArgs = args , ItemValue = itemValue } ) ;
13701386 }
13711387
13721388 #endregion
You can’t perform that action at this time.
0 commit comments