Skip to content

[Bug] Custom cursor settings get wiped out #688

@jiacona

Description

@jiacona

Describe the bug

Map cursor styles get clobbered by terra-draw. If you have a custom cursor style set on the map canvas, whenever setCursor('unset') is called, it removes any custom styles set by terra-draw, but doesn't restore the initial ones.

Terra Draw npm version

Using terra-draw 1.16.1 and terra-draw-maplibre-gl-adapter 1.1.1

To Reproduce

In maplibre, set a custom cursor. Hover over any terra-draw element and then back over the map. The cursor will have reverted to the default pointer.

Expected behavior

Whenever a terra-draw interaction modifies the cursor, it should revert to the previous cursor when it is done instead of deleting any custom styles.

Desktop (please complete the following information):
OS: macOS 15.6.1
Browser: Chrome
Version 140.0.7339.185

Additional context

We are maintaining our own fork and I have implemented a fix for this issue here. I don't know if it is the best approach, but if you have any guidance and think it would be a valuable fix for core, I would be happy to put together a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    MapLibreGLRelated to the MapLibreGL JS AdapterbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions