Skip to content

Mouse events report incorrect position when 2nd level parent is offset. #1744

@jec006

Description

@jec006

I've also reported this over at mapbox here: mapbox/mapbox.js#411 as it seems that they have this problem in an early version of leaflet.

The issue is that mouse events are offset when a 2nd (or third or fourth) level parent is offset vertically.

It appears that the event position is calculated based on the screen position + the scroll area. When the map element is positioned relatively it does not properly calculate its vertical offset when getting the coordinates of the mouse event.

I'm working on a pull request to fix this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions