From 776b3b9ed434086d3dcd8cf463b276ce45429b70 Mon Sep 17 00:00:00 2001 From: David Moreira Date: Sun, 29 Oct 2023 10:56:04 +0000 Subject: [PATCH] Fix wrong logic for Enter Key Post prevention --- Source/Extensions/Blazorise.DataGrid/DataGrid.razor | 4 +--- .../Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Extensions/Blazorise.DataGrid/DataGrid.razor b/Source/Extensions/Blazorise.DataGrid/DataGrid.razor index 5ddba65a12..375ed42c9b 100644 --- a/Source/Extensions/Blazorise.DataGrid/DataGrid.razor +++ b/Source/Extensions/Blazorise.DataGrid/DataGrid.razor @@ -12,13 +12,11 @@ }
- - @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. } - @if ( IsGroupableByColumn ) { diff --git a/Source/Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor.cs b/Source/Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor.cs index e87c225138..2bd9afdf34 100644 --- a/Source/Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor.cs +++ b/Source/Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor.cs @@ -84,7 +84,7 @@ protected async Task HandleCellKeyDown( KeyboardEventArgs args, DataGridColumn