mapbox / mapbox/mapbox-gl-draw
Firing an action if user clicks the trash control regardless of selection
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
Mapbox GL Version: 0.45.0
Mapbox GL Draw Version: 1.0.9
### Steps to Trigger Behavior
1. Click trash icon
### Expected Behavior
Event to fire
### Actual Behavior
No change or action fired
--
Hello --
I was wondering if an action fires when a user clicks the trash can icon when there is nothing selected.
I have a very simple mapbox draw component that users can draw a single polygon on. I am noticing that they are clicking the trash icon without selecting their polygon. I am wondering if an action fires when they click the trash (or how I can set one up) so that it will call deleteAll().
Either that or is there a way to modify the css of the trash icon when nothing is selected so I can make it look disabled?
Thanks!
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 tracing the trash control's click handling and its selection-dependent behavior; the issue names no file or test. Done requires a defined behavior when nothing is selected, such as an action that invokes deleteAll() or disabled visual treatment, with coverage for the empty-selection case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100