fixed dynamic keymap legends and keymap mode next not working correctly together

closes #4366
This commit is contained in:
Miodec 2023-06-12 12:11:20 +02:00
parent 9c2bcbd762
commit 3910349423

View file

@ -99,11 +99,16 @@ async function updateKeymapLegendCasing(): Promise<void> {
const states = getLegendStates();
if (states === undefined) return;
const keymapKeys = <HTMLElement[]>(
[...document.getElementsByClassName("keymapKey")].filter(
(el) => el.className === "keymapKey"
)
);
const keymapKeys = <HTMLElement[]>[
...document.getElementsByClassName("keymapKey"),
].filter((el) => {
const isKeymapKey = el.classList.contains("keymapKey");
const isNotSpace =
!el.classList.contains("keySpace") &&
!el.classList.contains("keySplitSpace");
return isKeymapKey && isNotSpace;
});
const layoutKeys = keymapKeys.map((el) => el.dataset["key"]);
if (layoutKeys.includes(undefined)) return;