Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DialogHeader] Allow dialog title exclusion from tab index #3137

Merged
merged 7 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3554,6 +3554,16 @@
If defined, this value will replace the one defined in the <see cref="T:Microsoft.FluentUI.AspNetCore.Components.DialogParameters"/>.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDialogHeader.ShowDismissTooltip">
<summary>
When true, shows the "Close" button tooltip in the header.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDialogHeader.TabIndex">
<summary>
Allows developers to make elements sequentially focusable and determine their relative ordering for navigation (usually with the Tab key).
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDialogHeader.ChildContent">
<summary>
Gets or sets the content to be rendered inside the component.
Expand Down
8 changes: 6 additions & 2 deletions src/Core/Components/Dialog/FluentDialogHeader.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Style="@StyleValue"
Class="@ClassValue"
Id="@Id">
<div style="width: 100%;" tabindex="0">
<div style="width: 100%;" tabindex="@TabIndex">
@if (@ChildContent == null && Dialog.Instance?.Parameters?.ShowTitle == true)
{
<FluentLabel Typo="Typography.PaneHeader">@Dialog.Instance?.Parameters?.Title</FluentLabel>
Expand All @@ -24,7 +24,11 @@
<FluentButton Id="dialog_close" Appearance="Appearance.Stealth" OnClick="@(() => Dialog.CancelAsync())" aria-label="@Dialog.Instance?.Parameters?.DismissTitle">
<FluentIcon Value="@(new CoreIcons.Regular.Size20.Dismiss())" Width="20px" Color="Color.Neutral" />
</FluentButton>
<FluentTooltip Anchor="dialog_close" Position="@TooltipPosition.Bottom">@Dialog.Instance?.Parameters?.DismissTitle</FluentTooltip>

if (ShowDismissTooltip == true)
{
<FluentTooltip Anchor="dialog_close" Position="@TooltipPosition.Bottom">@Dialog.Instance?.Parameters?.DismissTitle</FluentTooltip>
}
}
</FluentStack>
}
12 changes: 12 additions & 0 deletions src/Core/Components/Dialog/FluentDialogHeader.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ public partial class FluentDialogHeader : FluentComponentBase
[Parameter]
public bool? ShowDismiss { get; set; }

/// <summary>
/// When true, shows the "Close" button tooltip in the header.
/// </summary>
[Parameter]
public bool? ShowDismissTooltip { get; set; } = true;

/// <summary>
/// Allows developers to make elements sequentially focusable and determine their relative ordering for navigation (usually with the Tab key).
/// </summary>
[Parameter]
public int? TabIndex { get; set; } = 0;

/// <summary>
/// Gets or sets the content to be rendered inside the component.
/// </summary>
Expand Down
Loading