visgl / react-map-gl

React friendly API wrapper around MapboxGL JS
http://visgl.github.io/react-map-gl/
Other
7.88k stars 1.35k forks source link

[Bug] `cursor` prop does not reset to auto when set to undefined #2276

Closed blksnk closed 1 year ago

blksnk commented 1 year ago

Description

I set the cursor prop as either crosshair or undefined based on a boolean state. The cursor does not revert to its default behavior (grab interactions) once the prop value reverts back to undefined, but behaves as if no prop changes have occured.

Setting the prop to null seems to correct this issue, although it goes against type definitions.

Expected Behavior

Cursor behavior should revert back to default behavior once the cursor prop is unset.

Steps to Reproduce

https://codesandbox.io/s/react-map-gl-cursor-py2y4s

Environment

Logs

No response

Pessimistress commented 1 year ago

Fixed in 7.1.6