Skip to content

Commit c08f0e0

Browse files
Merge pull request #17 from stavroskasidis/release/2.1
Release 2.1
2 parents 02cb6ea + 2834e7c commit c08f0e0

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

BlazorDialog/BlazorDialog.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Copyright />
1515
<PackageTags>blazor blazor-component blazor-dialog dialog modal blazor-modal blazordialog blazormodaldialog blazormodal razor razor-components razorcomponents</PackageTags>
1616
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
17-
<Version>2.0.0</Version>
17+
<Version>2.1.0</Version>
1818
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version>
1919
<Product>BlazorDialog</Product>
2020
</PropertyGroup>

BlazorDialog/Components/Dialog.razor

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
/// <summary>
4848
/// The input provided to the dialog when opening.
4949
/// </summary>
50-
[Parameter] public object Input { get; set; }
50+
[Parameter] public object? Input { get; set; }
5151

5252
/// <summary>
5353
/// An event that is triggered before the dialog appears.
@@ -220,24 +220,26 @@
220220
await Show<object>();
221221
}
222222

223-
public async Task<TResult> Show<TResult>()
223+
public async Task<TResult?> Show<TResult>()
224224
{
225225
this.Input = null;
226-
return (TResult)await ShowInternal();
226+
var result = await ShowInternal();
227+
return result == null ? default : (TResult)result;
227228
}
228229

229230
public async Task Show(object input)
230231
{
231232
await this.Show<object>(input);
232233
}
233234

234-
public async Task<TResult> Show<TResult>(object input)
235+
public async Task<TResult?> Show<TResult>(object input)
235236
{
236237
this.Input = input;
237-
return (TResult)await ShowInternal();
238+
var result = await ShowInternal();
239+
return result == null ? default : (TResult)result;
238240
}
239241

240-
private async Task<object> ShowInternal()
242+
private async Task<object?> ShowInternal()
241243
{
242244
if (OnBeforeShow.HasDelegate)
243245
{

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ Make sure that there is a call to `app.UseStaticFiles();` in your server project
8282
8383
## Release Notes
8484

85-
<details open="open"><summary>2.0</summary>
85+
<details open="open"><summary>2.1</summary>
86+
87+
>- Minor fix for when returning null dialog results to non nullable result types.
88+
</details>
89+
90+
<details><summary>2.0</summary>
8691

8792
>- New feature: ShowComponentAsDialog. Check demo app for examples.
8893
>- Upgraded target framework to 6.0

0 commit comments

Comments
 (0)