Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Fix for inconsistent values from nativeEvent.offsetX and Y #19

Merged
merged 2 commits into from
Nov 2, 2019

Conversation

stevehawley
Copy link
Contributor

I was exploring a change to address issue #14 and ran into an issue with the selector that was caused by the use of offsetX and offsetY in getCoordPercentage.

MouseEvent offsets give inconsistent results when dragging up and to the left rather than the more natural down and to the right. The reason could be browser implementation (it is still experimental) or it could be that nativeEvent offsets are based on target rather than currentTarget, I don't know.

To keep consistent behavior with the selector use the bounding client rect to calculate offset values for the current element.

@Secretmapper Secretmapper merged commit 8dc568b into Secretmapper:master Nov 2, 2019
@Secretmapper
Copy link
Owner

Thanks for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants