visgl/react-map-gl

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

blksnk opened this issue · 1 comments

blksnk commented

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

  • Toggle cursor prop between a string and undefined

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

Environment

  • Framework version: react-map-gl@7.1.5
  • Map library: mapbox-gl@2.5.1
  • Browser: Arc 1.7.0 (41350)
  • Chromium: 116.0.5845.179
  • OS: MacOS Sonoma beta 14.0 (23A5337a)

Logs

No response

Fixed in 7.1.6