Skip to content

Commit 5b6b235

Browse files
committed
Defer panToKeepInView call to avoid conflicts with Leaflet's focus handlers
1 parent 832714d commit 5b6b235

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pcd-website/src/components/MapView.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,12 @@ onMounted(async () => {
431431
}
432432
});
433433
434-
if (foundNode) panToKeepInView(foundNode.lat, foundNode.lng);
434+
if (foundNode) {
435+
const lat = foundNode.lat;
436+
const lng = foundNode.lng;
437+
// Defer past Leaflet's own focus/keyboard handlers that may pan synchronously
438+
requestAnimationFrame(() => panToKeepInView(lat, lng));
439+
}
435440
};
436441
map.getContainer().addEventListener('focusin', slidingWindowHandler);
437442

0 commit comments

Comments
 (0)