mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-07 07:54:04 +08:00
refactor: replace jquery event with vanilla event
This commit is contained in:
parent
7e73d47f09
commit
b03ea666c8
1 changed files with 8 additions and 4 deletions
|
|
@ -744,14 +744,18 @@ function handleChar(
|
|||
handleSpace();
|
||||
}
|
||||
|
||||
const currentWord = TestWords.words.getCurrent();
|
||||
const doesCurrentWordHaveTab = /^\t+/.test(TestWords.words.getCurrent());
|
||||
const isCurrentCharTab = currentWord[TestInput.input.current.length] === "\t";
|
||||
|
||||
if (
|
||||
thisCharCorrect &&
|
||||
Config.language.startsWith("code") &&
|
||||
/^\t+/.test(TestWords.words.getCurrent()) &&
|
||||
TestWords.words.getCurrent()[TestInput.input.current.length] === "\t"
|
||||
doesCurrentWordHaveTab &&
|
||||
isCurrentCharTab
|
||||
) {
|
||||
// handleChar("\t", TestInput.input.current.length);
|
||||
$("#wordsInput").trigger($.Event("keydown", { key: "Tab", code: "Tab" }));
|
||||
const tabEvent = new KeyboardEvent("keydown", { key: "Tab", code: "Tab" });
|
||||
document.dispatchEvent(tabEvent);
|
||||
}
|
||||
|
||||
if (char !== "\n") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue