Trash button does nothing after deleting a vertex while the polygon remains selected
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
Research direction
Start by tracing how the trash button reflects selection state in direct_select and simple_select, then inspect the mode and UI tests that cover vertex deletion. Compare the interface after deleting a vertex with no vertices selected to its behavior after selecting a vertex or leaving vertex editing mode. Done means users can tell why deletion is unavailable while the existing deletion behavior in each mode remains unchanged.
Written by the indexing model from the issue text.
Description
Description
After deleting a polygon vertex using the trash button, the polygon remains in direct_select mode with no vertices selected. Clicking the trash button again does nothing, even though the polygon still appears selected.
I understand that trash deletes vertices in direct_select and whole features in simple_select. The confusing part is that the interface does not make that distinction clear, particularly after deleting a vertex.
Steps to reproduce
- Draw a polygon with at least five vertices.
- Enter vertex editing mode and select a vertex.
- Click the trash button to delete it.
- Without leaving editing mode or selecting another vertex, click the trash button again.
Actual behavior
The second click has no effect. There is no visible explanation that the user is still editing vertices and must select another vertex or leave editing mode to delete the polygon.
Expected behavior
Keep the existing deletion behavior, but make the current state clearer. For example:
- Disable the trash button when no vertices are selected in direct_select.
- Use a tooltip explaining that a vertex must be selected.
- Provide a visible distinction between feature selection and vertex editing.
The goal is to explain why deletion is unavailable without changing what the trash button deletes in each mode.
Environment
- mapbox-gl-draw: 1.5.2
- Map rendering library: MapLibre GL JS
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 610
- Avg merge
- 54m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from mapbox/mapbox-gl-draw
-
auto-triaged bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mapbox/mapbox-gl-draw#1080 ·
Maintainers usually reply within 1 day
-
auto-triaged bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
mapbox/mapbox-gl-draw#1615 ·
Maintainers usually reply within 1 day
-
auto-triaged bug
Difficulty 3/5 1-2 days Newbie friendliness 64/100
mapbox/mapbox-gl-draw#1601 · 1 reaction ·
Maintainers usually reply within 1 day
-
auto-triaged bug
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
mapbox/mapbox-gl-draw#1553 · 1 comment ·
Maintainers usually reply within 1 day
-
auto-triaged bug
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
mapbox/mapbox-gl-draw#1540 ·
Maintainers usually reply within 1 day
All issues in mapbox/mapbox-gl-draw
Similar issues
-
Upgrade listener stays on a custom server after close when `preClose` is setPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fastify/fastify-websocket#388 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DietrichGebert/ponytail#1343 ·
Maintainers usually reply within 1 day
-
cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swombat/souls-house#770 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day