Skip to content

Commit

Permalink
Fix wrong logic for Enter Key Post prevention
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Moreira committed Oct 29, 2023
1 parent 33bfeff commit 776b3b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Source/Extensions/Blazorise.DataGrid/DataGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
}
<Form>


@if ( IsCellEdit && ( CommandColumn?.SaveCommandAllowed == false ) )
@if ( IsCellEdit && ( CommandColumn is null || !CommandColumn.SaveCommandAllowed ) )
{
//Disable the default form behaviour where pressing enter submits the form and posts the page which is not expected in typical SPA fashion.
<Button Type="ButtonType.Submit" Disabled Display="Display.None"></Button>
}


@if ( IsGroupableByColumn )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected async Task HandleCellKeyDown( KeyboardEventArgs args, DataGridColumn<T
return;
}

if (args.Code == "Enter" )
if ( args.Code == "Enter" || args.Code == "NumpadEnter" )
{
await Save();
return;
Expand Down

0 comments on commit 776b3b9

Please sign in to comment.