Scenario:
I have 150 buttons placed in a scroll view for opening levels.
When a button is pressed, the scroll view entity is disabled and the level entity is enabled.
When I come back from level, the mouse is now stuck with scroll view: moving mouse up and down moves scroll view without pressing on mouse left button.
Is there any way I can refresh scrollview to release any click event on it?
The project has a weird issue that after a game, the browser window event ‘mouseup’ doesn’t fire when clicking on the game area. I can’t figure out why as it’s super weird.
Does something in the game changes/adds DOM element?
Whatever the entity that the SwipeEvent script is on is not getting destroyed so the event listeners aren’t being removed. Are the entities only being disabled instead?
Yes because the mouseup event listener in SwipeEvent wasn’t removed when the person returns to the level select screen. This means that ev.event.stopImmediatePropagation() is being called and preventing the scroll view from listening to mouseup to stop dragging
The fix would be to remove the mouseup event listener on SwipeEvent correctly. Is the entity it’s attached to disabled or destroyed when the user is returned to the main menu?