mapbox / mapbox/mapbox-gl-draw
Trash is disabled while programatically selecting feature from draw using direct select
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
I am trying to select a newly created object in draw in code.
`created_ids = draw.add(draw_feature);
draw.changeMode('direct_select',{featureId:created_ids[0]});`
The feature gets selected,but delete does not work on clicking trash icon.
When I deselect and reselect the feature using pointer delete works.
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 by reproducing the provided `draw.add(draw_feature)` and `draw.changeMode('direct_select', ...)` sequence, then compare trash behavior with pointer-based reselection. Trace the `direct_select` and trash interaction paths; done means deleting the programmatically selected feature works without deselecting and reselecting it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100