Select shortcut entries also
Some checks are pending
Tests / tests (push) Waiting to run

This commit is contained in:
Dustin Brett 2025-02-09 21:45:43 -08:00
parent 48f951db2e
commit 965c2dcc37
2 changed files with 8 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import { type FileManagerViewNames } from "components/system/Files/Views";
import { useFileSystem } from "contexts/fileSystem";
import { useProcesses } from "contexts/process";
import { useSession } from "contexts/session";
import { PREVENT_SCROLL } from "utils/constants";
import { PREVENT_SCROLL, SHORTCUT_EXTENSION } from "utils/constants";
import { haltEvent, sendMouseClick } from "utils/functions";
type KeyboardShortcutEntry = (file?: string) => React.KeyboardEventHandler;
@ -264,7 +264,9 @@ const useFileKeyboardShortcuts = (
blurEntry();
focusEntry(focusOnEntry);
fileManagerRef.current
?.querySelector(`button[aria-label='${focusOnEntry}']`)
?.querySelector(
`button[aria-label='${focusOnEntry.replace(SHORTCUT_EXTENSION, "")}']`
)
?.scrollIntoView();
}
}

View File

@ -19,6 +19,7 @@ import {
MAX_RES_ICON_OVERRIDE,
ONE_TIME_PASSIVE_EVENT,
PREVENT_SCROLL,
SHORTCUT_EXTENSION,
SUPPORTED_ICON_SIZES,
TASKBAR_HEIGHT,
TIMESTAMP_DATE_FORMAT,
@ -430,7 +431,9 @@ export const updateIconPositionsIfEmpty = (
if (!iconPositions[entryUrl]) {
const gridEntry = [...gridElement.children].find((element) =>
element.querySelector(`button[aria-label="${entry}"]`)
element.querySelector(
`button[aria-label="${entry.replace(SHORTCUT_EXTENSION, "")}"]`
)
);
if (gridEntry instanceof HTMLElement) {