Fix Settings button keep being added/removed from header

This commit is contained in:
redphx
2024-08-14 08:51:23 +07:00
parent d929a958ff
commit 382cd1aa51
4 changed files with 20 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ import { GamepadKey } from "@/enums/mkb";
import { EmulatedMkbHandler } from "@/modules/mkb/mkb-handler";
import { BxEvent } from "@/utils/bx-event";
import { STATES } from "@/utils/global";
import { CE } from "@/utils/html";
import { CE, isElementVisible } from "@/utils/html";
import { setNearby } from "@/utils/navigation-utils";
export enum NavigationDirection {
@@ -519,11 +519,8 @@ export class NavigationDialogManager {
return null;
}
const rect = $elm.getBoundingClientRect();
const isVisible = !!rect.width && !!rect.height;
// Ignore hidden element
if (!isVisible) {
if (!isElementVisible($elm)) {
return null;
}