diff options
author | Miodec <[email protected]> | 2023-03-07 20:15:34 +0100 |
---|---|---|
committer | Miodec <[email protected]> | 2023-03-07 20:15:34 +0100 |
commit | a336bda8ebfd4cd7dd6866e1f2e9ca9bcf283e44 (patch) | |
tree | 8a4db5f1d02fab59c98ade1144d0d197cc62111a | |
parent | de0ea5e288254ead827ac8e5a691cb88c4fb951f (diff) | |
download | monkeytype-a336bda8ebfd4cd7dd6866e1f2e9ca9bcf283e44.tar.gz monkeytype-a336bda8ebfd4cd7dd6866e1f2e9ca9bcf283e44.zip |
moving the words input to the 2nd line instead of center of the words wrapper
-rw-r--r-- | frontend/src/ts/test/test-ui.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts index a32c8bbb7..3d9002a55 100644 --- a/frontend/src/ts/test/test-ui.ts +++ b/frontend/src/ts/test/test-ui.ts @@ -208,15 +208,19 @@ function updateWordsInputPosition(force = false): void { "#words .active" ) as HTMLElement | null; - if (!shouldUpdate || !activeWord) { - const wordsWrapper = document.querySelector("#wordsWrapper") as HTMLElement; - el.style.top = wordsWrapper.offsetHeight / 2 + "px"; + if (!activeWord) { + el.style.top = "0px"; el.style.left = "0px"; return; } - el.style.top = activeWord.offsetTop + "px"; - el.style.left = activeWord.offsetLeft + "px"; + if (!shouldUpdate) { + el.style.top = activeWord.offsetHeight * 2 + "px"; + el.style.left = "0px"; + } else { + el.style.top = activeWord.offsetTop + "px"; + el.style.left = activeWord.offsetLeft + "px"; + } } function updateWordsHeight(force = false): void { |