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

Fix shortcuts changing multiple browser windows #2470

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Feb 27, 2024

Fixes #2467
Fixes #2459

  • Change ShortcutManager to an instance type and inject with scope lifetime
  • Pass manager instance to JavaScript and call instance method on it
  • IGlobalKeydownListener no longer implements IDisposable. We now rely on the implementing type to do clean up however it sees fit. This change was made because if a type implements IDisposable and IAsyncDisposable then only DisposeAsync is called. This was causing leaks in MainLayout which never called cleanup code in Dispose. Each instance was never unregistered from the shortcut manager.
  • Reference interfaces in code behind (prefer code behind when possible)
Microsoft Reviewers: Open in CodeFlow

@adamint adamint merged commit fcadd63 into main Feb 27, 2024
8 checks passed
@adamint adamint deleted the jamesnk/fix-global-shortcuts branch February 27, 2024 15:33
adamint pushed a commit to adamint/aspire that referenced this pull request Feb 27, 2024
* Fix shortcuts changing multiple browser windows

* Clean up

(cherry picked from commit fcadd63)
adamint pushed a commit to adamint/aspire that referenced this pull request Feb 27, 2024
* Fix shortcuts changing multiple browser windows

* Clean up

(cherry picked from commit fcadd63)
joperezr pushed a commit that referenced this pull request Feb 27, 2024
* 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 <[email protected]>
(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 <[email protected]>
Co-authored-by: Ratzman, Adam Mortimer <[email protected]>
(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 <[email protected]>
(cherry picked from commit 1434b99)

---------

Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: Tim Mulholland <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants