-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
mapbox-gl-js version
v3.15.0
Expected behavior
The following MapEvents types has a optional originalEvent property:
- zoomstart
- zoom
- zoomend
- pitchstart
- pitch
- pitchend
Actual behavior
The originalEvent inaccessible according to typescript.
Reason:
The listed events has a | void defined in the type.
Current:
"zoomstart": {
originalEvent?: WheelEvent | TouchEvent;
} | voidFixed:
"zoomstart": {
originalEvent?: WheelEvent | TouchEvent;
}Steps to trigger the unexpected behavior
const map = new mapboxgl.Map({ container: 'map' })
map.on('zoomstart', (e) => {
console.log(e.originalEvent) // <-- Type error
})