mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-10 15:17:45 +02:00
Clear focus on Game Bar after activating it
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { CE, createSvgIcon } from "@utils/html";
|
import { CE, clearFocus, createSvgIcon } from "@utils/html";
|
||||||
import { ScreenshotAction } from "./action-screenshot";
|
import { ScreenshotAction } from "./action-screenshot";
|
||||||
import { TouchControlAction } from "./action-touch-control";
|
import { TouchControlAction } from "./action-touch-control";
|
||||||
import { BxEvent } from "@utils/bx-event";
|
import { BxEvent } from "@utils/bx-event";
|
||||||
@@ -133,6 +133,9 @@ export class GameBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hideBar() {
|
hideBar() {
|
||||||
|
// Stop focusing Game Bar
|
||||||
|
clearFocus();
|
||||||
|
|
||||||
if (!this.$container) {
|
if (!this.$container) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -174,3 +174,9 @@ export function removeChildElements($parent: HTMLElement) {
|
|||||||
$parent.firstElementChild.remove();
|
$parent.firstElementChild.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function clearFocus() {
|
||||||
|
if (document.activeElement instanceof HTMLElement) {
|
||||||
|
document.activeElement.blur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user