ankitects / anki

Anki's shared backend and web components, and the Qt frontend
https://apps.ankiweb.net
Other
18.34k stars 2.09k forks source link

Noticeable delay after pressing space in editor field #3157

Closed sarsamurmu closed 4 months ago

sarsamurmu commented 5 months ago

Whenever I press space there is a delay before a response occurs. I've tried disabling all my add-ons, but this problem remains. This is what I've found using the inspector image The code that is causing the problem image Looks like the more mousemove occurs, the more listeners get added to the document. When I keep adding multiple cards, these buggy listeners also add up, and the delay becomes more than 2 seconds and the editor becomes unusable

I've tried finding the code but this code is probably not part of Anki codebase, or fabric.js codebase. Maybe some other dependency is causing this?

You can test this by moving around your mouse in editor while pressing space. After some time you would notice the lagging in the editor.

abdnh commented 4 months ago

Fixed in this PR: https://github.com/ankitects/anki/pull/3150

sarsamurmu commented 4 months ago

Awesome