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

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
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>
}
13 changes: 12 additions & 1 deletion src/Core/Components/Dialog/FluentDialogHeader.razor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Components;
using Microsoft.FluentUI.AspNetCore.Components.Utilities;

namespace Microsoft.FluentUI.AspNetCore.Components;

Expand All @@ -12,12 +11,12 @@
private FluentDialog Dialog { get; set; } = default!;

/// <summary />
protected string? ClassValue => new CssBuilder(Class)

Check failure on line 14 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Deploy Demo site

The type or namespace name 'CssBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 14 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Deploy Demo site

The type or namespace name 'CssBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 14 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'CssBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 14 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'CssBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 14 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'CssBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 14 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'CssBuilder' could not be found (are you missing a using directive or an assembly reference?)
.AddClass("fluent-dialog-header")
.Build();

/// <summary />
protected string? StyleValue => new StyleBuilder(Style)

Check failure on line 19 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Deploy Demo site

The type or namespace name 'StyleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 19 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Deploy Demo site

The type or namespace name 'StyleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 19 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'StyleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 19 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'StyleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 19 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'StyleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 19 in src/Core/Components/Dialog/FluentDialogHeader.razor.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

The type or namespace name 'StyleBuilder' could not be found (are you missing a using directive or an assembly reference?)
.Build();

/// <summary>
Expand All @@ -34,6 +33,18 @@
[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