mapbox / mapbox/mapbox-gl-draw

onMouseEnter starts drawing and ends drawing

Open
#910 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs information ui
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

mapbox-gl-js version: @latest
mapbox-gl-draw version: @latest

Expected Behavior

I add the draw control on map init and I have custom button for multiple draw types.
Rectangle, Free Polygon. so in DEV environment drawing works completely fine and perfect.
In dev recorded video
https://drive.google.com/file/d/1m1TEqQMjOgdDvFxk2HRihJMmuqLZX5WS/view

Actual Behavior after build

When I create build in react it does not behave correct.
after building project DrawControl starts drawing on mouseover automatically but it should start drawing on Click and end drawing on click.
In build it starts on mouseenter and automatically stops while the cursor is on the map.
If you need any.
This is current behavior after build.
https://drive.google.com/file/d/1aH0G7bcU9_fP3g6-o1l0n782fZzyu5w_/view

Please tell me if you need anything else to help me.
Thanks.

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

Reproduce the behavior in a production React build using the reported mapbox-gl-js and mapbox-gl-draw versions, custom draw buttons, and the linked videos as comparison points. Trace the mouseenter and click event handling around the draw control and identify why build output changes it. Done means drawing starts and ends only on click, matching development behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.