Mouse leave event not appears after touch on cesium viewer

Hi guys!

I have cesium viewer on my page and one small icon (div) with two event handlers: 'click' and 'mouseleave'.
- by click (touch) on this icon I'm showing small menu;
- when cursor leave this menu (on mouseleave), I hide it.

When I'm opening this app on iPad, 'mouseleave' event not appears when I'm touching Cesium viewer, but it works when I'm touching any other element on my page. I think it because of Cesium using preventDefault() in it mouse\touch event handlers.

Can you help me resolve this issue?

Thank in advance!

Hey there,

I don’t think is Cesium specific, but rather that the mouseleave and other mouse movement events aren’t always supported on all touch devices.

Thanks,

Gabby

Hi Gabby

The thing is that I have a lot of other elements on my page (like div, img, label etc.) and when I touch any other element on page 'muoseleave' event appears, but when touch is inside viewer it doesn't appears!

Hi,

I still wouldn’t recommend using it for a touch device even outside of the scope of Cesium. The ‘mouseleave’ event has different behaviors across desktop and mobile in different browsers. I’d implement separate touch logic with touch events.

Thanks,

Gabby