mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-25 08:53:04 +02:00
Clear focus on Game Bar after activating it
This commit is contained in:
parent
4d90ebca68
commit
756d105f74
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user