Skip to content

Commit

Permalink
fix(Table): ItemChangedType doesn't pass correct value to EditTemplat…
Browse files Browse the repository at this point in the history
…e on Drawer mode (#4750)

* feat(Table): add cascade value ItemChagnedType for edit template

* chore: bump version 9.0.2-beta04
  • Loading branch information
ArgoZhang authored Nov 28, 2024
1 parent 81e8297 commit 341ffda
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.0.2-beta03</Version>
<Version>9.0.2-beta04</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
40 changes: 21 additions & 19 deletions src/BootstrapBlazor/Components/Dialog/EditDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@
@attribute [BootstrapModuleAutoLoader("Dialog/EditDialog.razor.js", AutoInvokeInit = false, AutoInvokeDispose = false)]

<ValidateForm Model="@Model" OnValidSubmit="@OnValidSubmitAsync" DisableAutoSubmitFormByEnter="@DisableAutoSubmitFormByEnter">
@if (BodyTemplate != null)
{
<div class="form-body">
@BodyTemplate(Model)
</div>
<div class="form-footer">
@RenderFooter
</div>
}
else
{
<EditorForm TModel="TModel" Items="Items" ItemChangedType="ItemChangedType" ItemsPerRow="ItemsPerRow" RowType="RowType" LabelAlign="LabelAlign" ShowLabel="ShowLabel" ShowUnsetGroupItemsOnTop="ShowUnsetGroupItemsOnTop">
<Buttons>
<CascadingValue Value="ItemChangedType" IsFixed="true">
@if (BodyTemplate != null)
{
<div class="form-body">
@BodyTemplate(Model)
</div>
<div class="form-footer">
@RenderFooter
</Buttons>
</EditorForm>
}
<div class="form-loader fade" id="@Id">
<Spinner Color="Color.Primary" />
</div>
</div>
}
else
{
<EditorForm TModel="TModel" Items="Items" ItemChangedType="ItemChangedType" ItemsPerRow="ItemsPerRow" RowType="RowType" LabelAlign="LabelAlign" ShowLabel="ShowLabel" ShowUnsetGroupItemsOnTop="ShowUnsetGroupItemsOnTop">
<Buttons>
@RenderFooter
</Buttons>
</EditorForm>
}
<div class="form-loader fade" id="@Id">
<Spinner Color="Color.Primary" />
</div>
</CascadingValue>
</ValidateForm>

0 comments on commit 341ffda

Please sign in to comment.