monkeytypegame / monkeytype

The most customizable typing website with a minimalistic design and a ton of features. Test yourself in various modes, track your progress and improve your speed.
https://monkeytype.com/
GNU General Public License v3.0
15.01k stars 2.29k forks source link

Typing stops being smooth when opening another tab #3651

Closed pypp closed 1 year ago

pypp commented 1 year ago

Did you clear cache before opening an issue?

Is there an existing issue for this?

Does the issue happen when logged in?

Yes

Does the issue happen when logged out?

Yes

Does the issue happen in incognito mode when logged in?

Yes

Does the issue happen in incognito mode when logged out?

Yes

Account name

paimon

Account config

No response

Current Behavior

When starting to type, if mid typing test I open another tab and search something then come back to MonkeyType it's becomes laggy, like the smooth cursor stops working.

Expected Behavior

I expect the typing to stay smooth when searching something in another tab and then going back to the typing test.

Steps To Reproduce

  1. Start typing
  2. open new tab and google something or enter url
  3. go back to MoneyType to keep typing
  4. typing becomes not smooth

Environment

Anything else?

No response

pypp commented 1 year ago

I managed to recreate the issue:

https://user-images.githubusercontent.com/55145572/195861958-6d1fcad6-b829-4122-9fba-dd041b8c8b46.mp4

I'm not sure how noticeable the issue is in the video.

Miodec commented 1 year ago

When the tab loses focus browsers will limit the resources available to it. This might cause the test timer to drift (seconds taking longer or shorter than an actual second) - to compensate, the animations will be disabled to limit the amount of resources need as much as possible while trying to keep the test running. If the timer drifts too much the test is automatically stopped. This is working as intended.