-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix keyboard shortcuts, url casing and JSDisconnectedException (#2466)
* Fix keyboard shortcuts and url casing * Suppress JSDisconnectedException * Check MetaKey and refactor modifier key checks --------- Co-authored-by: Adam Ratzman <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Aspire.Dashboard/Extensions/KeyboardEventArgsExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.AspNetCore.Components.Web; | ||
|
||
namespace Aspire.Dashboard.Extensions; | ||
|
||
internal static class KeyboardEventArgsExtensions | ||
{ | ||
public static bool NoModifiersPressed(this KeyboardEventArgs args) | ||
{ | ||
return !args.AltKey && !args.CtrlKey && !args.MetaKey && !args.ShiftKey; | ||
} | ||
|
||
public static bool OnlyShiftPressed(this KeyboardEventArgs args) | ||
{ | ||
return args.ShiftKey && !args.AltKey && !args.CtrlKey && !args.MetaKey; | ||
} | ||
} |