Trash button does nothing after deleting a vertex while the polygon remains selected

Open
#1,636 1 comment 0 reactions 0 assignees View on GitHub

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
Domain
design, frontend

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

auto-triaged feature

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

  1. Draw a polygon with at least five vertices.
  2. Enter vertex editing mode and select a vertex.
  3. Click the trash button to delete it.
  4. 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

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.

More from mapbox/mapbox-gl-draw

All issues in mapbox/mapbox-gl-draw

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.