ajmas / StuffInSpace

A real-time interactive WebGL visualisation of objects in Earth orbit
https://ajmas.github.io/StuffInSpace/
25 stars 9 forks source link

Scroll-wheel in the satellite list window ends up zooming #48

Closed ajmas closed 10 months ago

ajmas commented 10 months ago

The expectation when I use the scroll wheel in the satellite list window is to scroll the list. Right now this ends up interacting with the zoom function. We should makes sure that any time the cursor is in a window that the scroll wheel does not get handled by the viewer.

Logic should be added to the onWheel method to detect where the mouse is and then ignore the event, if there is any element between the mouse and the canvas.

thkruz commented 10 months ago

Speaking from memory, I think it might be easier to just move the listener to the canvas. If the mouse is over the other dom elements then the listener won't fire.

ajmas commented 10 months ago

That would probably be the easiest approach and I’m good with that. It’s actually better to move the maximum of these events to the canvas anyhow.