-
Notifications
You must be signed in to change notification settings - Fork 543
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
Fix keyboard shortcuts, url casing and JSDisconnectedException #2466
Conversation
This goes into p4 right? |
@davidfowl Pending discussion mentioned here: #2465 (review) |
@@ -184,7 +184,7 @@ private void SetPanelSizes(float panel1Fraction) | |||
|
|||
public async Task OnPageKeyDownAsync(KeyboardEventArgs args) | |||
{ | |||
if (_splitterRef is null || !args.ShiftKey) | |||
if (_splitterRef is null || !args.ShiftKey || args.AltKey || args.CtrlKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also the MetaKey to check for. TIL that's the Windows key, or whatever your device equivalent is.
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this logic into a helper method somewhere and reuse from all the OnPageKeyDownAsync places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. I didn't realize that was what MetaKey was... but also all the keyboard shortcuts I tried with the windows key seemed to get intercepted before the browser got them. But I'll add it anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added that check.
Put this logic into a helper method somewhere and reuse from all the OnPageKeyDownAsync places.
Done. Though have I mentioned I hate naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for tomorrow before merging.
Merging, combining the three separate PR commits and cherry picking back into p4 |
* Fix shortcuts changing multiple browser windows (#2470) * Fix shortcuts changing multiple browser windows * Clean up (cherry picked from commit fcadd63) * 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 <adam@adamratzman.com> (cherry picked from commit 197c21e) * Untrack DialogReference when dialog is closed (#2465) * Untrack DialogReference when dialog is closed * Fix keyboard shortcuts and url casing * Suppress JSDisconnectedException * Check MetaKey and refactor modifier key checks * removed redundant extra OnDialogCloseRequested call --------- Co-authored-by: Adam Ratzman <adam@adamratzman.com> Co-authored-by: Ratzman, Adam Mortimer <aratzman@iu.edu> (cherry picked from commit 0a7b6c7) * Use OnDialogClosing instead of OnDialogResult to remove dialog reference in MainLayout (#2476) * Use OnDialogClosing instead of OnDialogResult * Remove redundant event listener --------- Co-authored-by: Adam Ratzman <adamratzman@microsoft.com> (cherry picked from commit 1434b99) --------- Co-authored-by: James Newton-King <james@newtonking.com> Co-authored-by: Tim Mulholland <tlmii@users.noreply.github.com>
Fixes #2458
Fixes #2461
Fixes #2462
I'm a little surprised KeyboardEventArgs doesn't have a modifierkeys flags enum or something, so the checks to ensure other modifier keys (alt, ctrl) are not pressed are a little uglier than they could be. But this ensures they're only getting fired when the appropriate modifier keys (shift in some cases, none in others) are pressed.
Microsoft Reviewers: Open in CodeFlow