[Dialog] Remove tabindex=-1 on fluent-dialog tag (#2584)

* - Remove tabindex=-1 on fluent-dialog
- Add null checks

* Update Dialog verified files
This commit is contained in:
Vincent Baaij 2024-08-26 21:08:55 +02:00 коммит произвёл GitHub
Родитель 8496705f83
Коммит 168a896239
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
7 изменённых файлов: 20 добавлений и 16 удалений

Просмотреть файл

@ -1,4 +1,4 @@
@namespace Microsoft.FluentUI.AspNetCore.Components
@namespace Microsoft.FluentUI.AspNetCore.Components
@using Microsoft.AspNetCore.Components.Rendering
@inherits FluentComponentBase
@ -13,8 +13,7 @@
aria-describedby=@(_parameters.AriaDescribedby ?? AriaDescribedby)
aria-labelledby=@(_parameters.AriaLabelledby ?? AriaLabelledby)
aria-label=@(_parameters.AriaLabel ?? AriaLabel)
@attributes=@AdditionalAttributes
tabindex="-1">
@attributes=@AdditionalAttributes>
@* Default Header *@
@if (HasDefaultDialogHeader)
@ -39,4 +38,4 @@
}
</fluent-dialog>
</CascadingValue>
</CascadingValue>

Просмотреть файл

@ -165,7 +165,10 @@ public partial class FluentDialog : FluentComponentBase
public void Show()
{
Hidden = false;
Instance.Parameters.Visible = true;
if (Instance is not null)
{
Instance.Parameters.Visible = true;
}
RefreshHeaderFooter();
}
@ -175,8 +178,10 @@ public partial class FluentDialog : FluentComponentBase
public void Hide()
{
Hidden = true;
Instance.Parameters.Visible = false;
//RefreshHeaderFooter();
if (Instance is not null)
{
Instance.Parameters.Visible = false;
}
}
/// <summary>

Просмотреть файл

@ -1,5 +1,5 @@
<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: 200px;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" tabindex="-1" b-dsxskpj5rr="" blazor:elementreference="">
<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: 200px;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" b-dsxskpj5rr="" blazor:elementreference="">
<div class="stack-horizontal fluent-dialog-header" style="justify-content: start; align-items: start; column-gap: 10px; row-gap: 10px; width: 100%;" b-0nr62qx0mz="">
<div style="width: 100%;">
<h4 typo="pane-header" class="fluent-typography" b-1nnnfjehkp="">Sample title</h4>
@ -16,4 +16,4 @@
<div class="fluent-dialog-body">
My body
</div>
</fluent-dialog>
</fluent-dialog>

Просмотреть файл

@ -1,5 +1,5 @@
<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" tabindex="-1" b-dsxskpj5rr="" blazor:elementreference="">
<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" b-dsxskpj5rr="" blazor:elementreference="">
<div class="stack-horizontal fluent-dialog-header" style="justify-content: start; align-items: start; column-gap: 10px; row-gap: 10px; width: 100%;" b-0nr62qx0mz="">
<div style="width: 100%;">
<h4 typo="pane-header" class="fluent-typography" b-1nnnfjehkp="">Sample title</h4>
@ -16,4 +16,4 @@
<div class="fluent-dialog-body">
My body
</div>
</fluent-dialog>
</fluent-dialog>

Просмотреть файл

@ -1,5 +1,5 @@
<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" tabindex="-1" b-dsxskpj5rr="" blazor:elementreference="">
<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" b-dsxskpj5rr="" blazor:elementreference="">
<div class="stack-horizontal fluent-dialog-header" style="justify-content: start; align-items: start; column-gap: 10px; row-gap: 10px; width: 100%;" b-0nr62qx0mz="">
<div style="width: 100%;">
<h4 typo="pane-header" class="fluent-typography" b-1nnnfjehkp="">Render Fragment Example</h4>
@ -17,4 +17,4 @@
<fluent-button type="button" aria-label="OK" title="OK" appearance="accent" blazor:onclick="3" b-x1200685t0="" blazor:elementreference="xxx">OK</fluent-button>
<fluent-button type="button" aria-label="Cancel" title="Cancel" appearance="neutral" blazor:onclick="4" b-x1200685t0="" blazor:elementreference="xxx">Cancel</fluent-button>
</div>
</fluent-dialog>
</fluent-dialog>

Просмотреть файл

@ -1,2 +1,2 @@
<fluent-dialog class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" tabindex="-1" b-dsxskpj5rr="" blazor:elementreference="xxx">My dialog content</fluent-dialog>
<fluent-dialog class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" b-dsxskpj5rr="" blazor:elementreference="xxx">My dialog content</fluent-dialog>

Просмотреть файл

@ -1,5 +1,5 @@
<fluent-dialog class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" tabindex="-1" b-dsxskpj5rr="" blazor:elementreference="">
<fluent-dialog class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: unset;" modal="true" trap-focus="true" b-dsxskpj5rr="" blazor:elementreference="">
<div class="stack-horizontal fluent-dialog-header" style="justify-content: start; align-items: start; column-gap: 10px; row-gap: 10px; width: 100%;" b-0nr62qx0mz="">
<div style="width: 100%;">
Header content
@ -17,4 +17,4 @@
<div class="stack-horizontal fluent-dialog-footer" style="justify-content: start; align-items: end; column-gap: 10px; row-gap: 10px; width: 100%;" b-0nr62qx0mz="">
Footer content
</div>
</fluent-dialog>
</fluent-dialog>