Open AndrewCasta opened 1 year ago
I can reproduce this. In my own app it happens frequently but not always. On https://nebula.gl/geojson-editor/ I can't get it to happen. When I run https://github.com/uber/nebula.gl/tree/master/examples/advanced locally I can quite easily reproduce it but only if I have the inspector in Chrome open at the same time (!).
I wonder if this has anything to do with how React optimises state updates...
A little late on this but I've just come across with the same problem. It seeems to only happen when the browser's DevTools are open.
nebula.gl is no longer active. A fork has been started in the deck.gl-community repo, see discussions for links.
Describe the bug
When attempting to click & drag (to add a point & position it) in one mouse click, an existing point is dragged instead of creating a new one.
It appears that onEdit is being called for the 'movePosition' editType, with feature data that has not been updated yet from the initial 'addPosition' onEdit call, causing the movePosition edit to override the feature data with its outdated data.
Actual Result
An existing point is dragged.
Expected Result
The new point should be dragged.
Reproduce Steps
Screenshots
https://user-images.githubusercontent.com/69061229/231071474-d74f9c95-8a63-406b-a06a-cee5866fd8ad.mp4
To Do List
@nebula.gl/edit-modes: 1.0.4 @nebula.gl/layers: 1.0.4 deck.gl: 8.9.4 React: 17.0.2
Simple component running at the root of React app