These lines for removing event listeners seems suspicious. Although they might not directly relate to this issue, they seem wrong. The correct way is to create a named function for the event handler and pass that to the removeEventListener function. Otherwise, the added listeners are separate object than the listeners that are specified to remove.
Description
If AnimatedCursor is rendered conditionally, the cursor will stay invisible even when AnimatedCursor is removed from the render tree.
To Produce
Potential Fix
These lines for removing event listeners seems suspicious. Although they might not directly relate to this issue, they seem wrong. The correct way is to create a named function for the event handler and pass that to the
removeEventListener
function. Otherwise, the added listeners are separate object than the listeners that are specified to remove.