From 520f51d251397dd03a4409044bbbba3e166e17db Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 10 Jul 2023 16:48:46 +0200 Subject: [PATCH] fixed layoutfluid not highlighting key after space --- frontend/src/ts/test/funbox/funbox.ts | 34 +++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/ts/test/funbox/funbox.ts b/frontend/src/ts/test/funbox/funbox.ts index 17486c8a5..2777ff5e1 100644 --- a/frontend/src/ts/test/funbox/funbox.ts +++ b/frontend/src/ts/test/funbox/funbox.ts @@ -305,12 +305,14 @@ FunboxList.setFunboxFunctions("layoutfluid", { UpdateConfig.setLayout(layouts[index]); UpdateConfig.setKeymapLayout(layouts[index]); } - KeymapEvent.highlight( - TestWords.words - .getCurrent() - .charAt(TestInput.input.current.length) - .toString() - ); + setTimeout(() => { + KeymapEvent.highlight( + TestWords.words + .getCurrent() + .charAt(TestInput.input.current.length) + .toString() + ); + }, 1); } }, getResultContent(): string { @@ -318,15 +320,17 @@ FunboxList.setFunboxFunctions("layoutfluid", { }, restart(): void { if (this.applyConfig) this.applyConfig(); - KeymapEvent.highlight( - TestWords.words - .getCurrent() - .substring( - TestInput.input.current.length, - TestInput.input.current.length + 1 - ) - .toString() - ); + setTimeout(() => { + KeymapEvent.highlight( + TestWords.words + .getCurrent() + .substring( + TestInput.input.current.length, + TestInput.input.current.length + 1 + ) + .toString() + ); + }, 1); }, });