mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
fix(style): weird shifting behavior when typing test that is only one line
This commit is contained in:
parent
2890dc7db1
commit
85007b7412
2 changed files with 6 additions and 11 deletions
|
|
@ -479,6 +479,7 @@
|
|||
z-index: -1;
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#capsWarning {
|
||||
|
|
|
|||
|
|
@ -405,23 +405,17 @@ export function updateWordsInputPosition(initial = false): void {
|
|||
initial &&
|
||||
!posUpdateLangList.some((l) => Config.language.startsWith(l))
|
||||
) {
|
||||
el.style.left = "0px";
|
||||
el.style.left = activeWord.offsetLeft + "px";
|
||||
el.style.top =
|
||||
// wordsWrapperTop +
|
||||
activeWord.offsetHeight * 2 +
|
||||
activeWordMargin * 1.5 +
|
||||
activeWord.offsetTop +
|
||||
activeWord.offsetHeight +
|
||||
-el.offsetHeight +
|
||||
(activeWord.offsetHeight + activeWordMargin) +
|
||||
"px";
|
||||
} else {
|
||||
el.style.left = activeWord.offsetLeft + "px";
|
||||
el.style.top =
|
||||
activeWord.offsetTop -
|
||||
activeWordMargin +
|
||||
// wordsWrapperTop +
|
||||
activeWord.offsetHeight +
|
||||
activeWordMargin +
|
||||
-el.offsetHeight +
|
||||
"px";
|
||||
activeWord.offsetTop + activeWord.offsetHeight + -el.offsetHeight + "px";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue