Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed Apr 27, 2024
1 parent 7e3eed5 commit c0014ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ public static void OnKeyDown(this IAriaPopup popup, KeyboardEventArgs eventArgs)
}
}

private static readonly object scrollOptions = new { Behavior = "smooth", Block = "nearest" };
private static readonly object ScrollOptions = new { Behavior = "smooth", Block = "nearest" };

private static async Task ScrollIntoViewAsync(IAriaPopup popup)
{
var id = popup.GetId(popup.ActiveDescendant);
if (id == null) return;

await using var element = await popup.JSRuntime.InvokeAsync<IJSObjectReference>("document.getElementById", id);
await element.InvokeVoidAsync("scrollIntoView", scrollOptions);
await element.InvokeVoidAsync("scrollIntoView", ScrollOptions);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ public interface IAriaPopup : IAriaControl, IAriaLabeled, IOpenClose, IWithTrans

IAriaComponentPart? Button { get; set; }

// ReSharper disable once InconsistentNaming
internal IJSRuntime JSRuntime { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageOutputPath>..\..\..\nuget</PackageOutputPath>
<NoWarn>BL0007</NoWarn>
<NoWarn>BL0007,MA0004</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

Expand Down

0 comments on commit c0014ba

Please sign in to comment.