@if (@ChildContent == null && Dialog.Instance?.Parameters?.ShowTitle == true)
{
-
@Dialog.Instance?.Parameters?.Title
+
@Dialog.Instance?.Parameters?.Title
}
else
{
diff --git a/src/Core/Components/Dialog/FluentDialogProvider.razor.cs b/src/Core/Components/Dialog/FluentDialogProvider.razor.cs
index a9b2170ed0..6718d4813f 100644
--- a/src/Core/Components/Dialog/FluentDialogProvider.razor.cs
+++ b/src/Core/Components/Dialog/FluentDialogProvider.razor.cs
@@ -91,7 +91,7 @@ private async Task
ShowDialogAsync(IDialogReference dialogRefe
dialogReference.Instance = dialog;
_internalDialogContext.References.Add(dialogReference);
- InvokeAsync(StateHasChanged);
+ await InvokeAsync(StateHasChanged);
return dialogReference;
});
diff --git a/src/Core/Components/Dialog/Parameters/DialogParameters.cs b/src/Core/Components/Dialog/Parameters/DialogParameters.cs
index 048f2d523d..d2573c4518 100644
--- a/src/Core/Components/Dialog/Parameters/DialogParameters.cs
+++ b/src/Core/Components/Dialog/Parameters/DialogParameters.cs
@@ -39,6 +39,12 @@ public virtual HorizontalAlignment Alignment
///
public string? Title { get; set; }
+ ///
+ /// Gets or sets the style for the title text.
+ /// Defaults to .
+ ///
+ public Typography TitleTypo { get; set; } = Typography.PaneHeader;
+
///
/// Determines if the dialog is modal. Defaults to true.
/// Obscures the area around the dialog.
diff --git a/src/Core/Components/Dialog/Parameters/IDialogParameters.cs b/src/Core/Components/Dialog/Parameters/IDialogParameters.cs
index 675d339988..591c6c312b 100644
--- a/src/Core/Components/Dialog/Parameters/IDialogParameters.cs
+++ b/src/Core/Components/Dialog/Parameters/IDialogParameters.cs
@@ -11,6 +11,7 @@ public interface IDialogParameters
string Id { get; set; }
HorizontalAlignment Alignment { get; set; }
string? Title { get; set; }
+ Typography TitleTypo { get; set; }
bool? Modal { get; set; }
bool? TrapFocus { get; set; }
bool ShowTitle { get; set; }
diff --git a/tests/Core/Dialog/FluentDialogServiceTests.FluentDialogService_ChangeHeaderTypo.verified.razor.html b/tests/Core/Dialog/FluentDialogServiceTests.FluentDialogService_ChangeHeaderTypo.verified.razor.html
new file mode 100644
index 0000000000..aa48728f13
--- /dev/null
+++ b/tests/Core/Dialog/FluentDialogServiceTests.FluentDialogService_ChangeHeaderTypo.verified.razor.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ My body
+
+
\ No newline at end of file
diff --git a/tests/Core/Dialog/FluentDialogServiceTests.razor b/tests/Core/Dialog/FluentDialogServiceTests.razor
index aaed62907f..17f6c3eb6e 100644
--- a/tests/Core/Dialog/FluentDialogServiceTests.razor
+++ b/tests/Core/Dialog/FluentDialogServiceTests.razor
@@ -36,6 +36,29 @@
cut.Verify();
}
+ [Fact]
+ public async Task FluentDialogService_ChangeHeaderTypo()
+ {
+ Services.AddFluentUIComponents();
+
+ // Arrange
+ var cut = Render(@);
+ var dialogService = Services.GetRequiredService();
+
+ // Act
+ var dialog = await dialogService.ShowDialogAsync(new DialogParameters()
+ {
+ Height = "200px",
+ Title = "Sample title as H2",
+ TitleTypo = Typography.H2,
+ PreventDismissOnOverlayClick = true,
+ PreventScroll = true,
+ });
+
+ // Assert
+ cut.Verify();
+ }
+
[Fact]
public async Task FluentDialogService_HeightUnset()
{