-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
I'm experiencing an issue where clicking on a map scrolls the entire page to the right. This is due to the logic error below, where the x coordinate is incorrectly calculated from the y coordinate. This is only noticeable on pages that have a horizontal scrollbar.
I'm new to Leaflet so not sure the best way to supply this (patch, pull request, something else?) but here is the fix.
diff --git a/src/map/handler/Map.Keyboard.js b/src/map/handler/Map.Keyboard.js
index dabbc02..ddf6759 100644
--- a/src/map/handler/Map.Keyboard.js
+++ b/src/map/handler/Map.Keyboard.js
@@ -65,7 +65,7 @@ L.Map.Keyboard = L.Handler.extend({
var body = document.body,
docEl = document.documentElement,
top = body.scrollTop || docEl.scrollTop,
- left = body.scrollTop || docEl.scrollLeft;
+ left = body.scrollLeft || docEl.scrollLeft;
this._map._container.focus();
Metadata
Metadata
Assignees
Labels
No labels