mapbox / mapbox/mapbox-gl-draw

Trash is disabled while programatically selecting feature from draw using direct select

Open
#717 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

api bug ui
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.