Marker jumps back to initial position during drag
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.5k
- Forks
- 1.4k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 3
Description
If using onDragEnd to only update the internal app state when dragging is done instead of onDrag to constantly update it, the marker jumps back to the initial position whenever <Marker> rerenders even if none of the props changed.
I think this should not use marker.getLngLat() for comparison because this is update during draging but should save and use the last passed position from the caller.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/react-maplibre/src/components/marker.ts at lines 105-107, then reproduce a drag using onDragEnd followed by a Marker rerender. Check how the caller's last position is compared with the marker position; done means the marker no longer jumps back when rerendered without prop changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100