I just upgraded National Map to use the head of master and ran into some problems introduced by pull request #2408. I submitted a pull request to fix one of the problems, but there’s another one that needs some discussion.
The problem is that after upgrading Cesium, dragging things is completely broken on my page. Specifically, dragging sliders doesn’t work and dragging/dropping within the app doesn’t work. Dragging the Cesium globe is fine.
I eventually tracked it down to this line in ScreenSpaceEventHandler:
Basically, Cesium is registering a mousemove handler on the document, and then canceling the event if a mouse button is currently held down. That’s reasonable if the button was pressed inside the Cesium canvas, perhaps. But it’s happening no matter where on the page the user pressed down the button.
So I’ve simply removed the preventDefault in my app and life is good, I guess. I’m not sure exactly what that preventDefault is supposed to be preventing. Hover styles from taking effect while dragging the globe?
If we do need the preventDefault, perhaps it should move to CameraEventAggregator? That class is able to distinguish between mousedowns that started inside the Cesium canvas and mousedowns that started elsewhere, unlike ScreenSpaceEventHandler (at least after #2408).
What do you think?