mapbox / mapbox/mapbox-gl-compare
Slider position was wrong with mouse moving after the "margin-left" css of map was added
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 152
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
I tried to add the two maps with comparison inside a DIV. It worked in the beginning. But after adding the "margin-left" css to the DIV and expending the width of the maps, the slider position was wrong with mouse moving. There was an offset between the mouse position and the slider. The offset value is just the value of "margin-left". Do you have any thoughts to fix the issue? 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
Reproduce the issue with two maps inside a DIV, adding margin-left and expanding the map width as described. Trace the slider's mouse-position calculation and verify that the slider stays aligned with the pointer when the container has a left margin.
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
- Needs clarification
- Newbie friendliness
- 35/100