fix(typing): first space sometimes soft locking the website

This commit is contained in:
Miodec 2024-02-19 13:25:02 +01:00
parent 0cc1e2a07e
commit e94b9cb821
2 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,6 @@ import * as TestWords from "../test/test-words";
import * as Hangul from "hangul-js";
import * as CustomTextState from "../states/custom-text-name";
import * as FunboxList from "../test/funbox/funbox-list";
import * as Settings from "../pages/settings";
import * as KeymapEvent from "../observables/keymap-event";
import { IgnoredKeys } from "../constants/ignored-keys";
import { ModifierKeys } from "../constants/modifier-keys";
@ -193,7 +192,6 @@ function handleSpace(): void {
f.functions.handleSpace();
}
}
Settings.groups["layout"]?.updateUI();
dontInsertSpace = true;

View file

@ -82,7 +82,12 @@ export default class SettingsGroup<T extends SharedTypes.ConfigValue> {
if (this.mode === "select") {
const select = document.querySelector(
`.pageSettings .section[data-config-name='${this.configName}'] select`
) as HTMLSelectElement;
) as HTMLSelectElement | null;
if (select === null) {
return;
}
select.value = this.configValue as string;
//@ts-expect-error