From 5c9d911e4fd2669c78086004460d3e459e72da8d Mon Sep 17 00:00:00 2001 From: Yoad Snapir Date: Fri, 10 Mar 2017 11:29:59 +0200 Subject: [PATCH] Fix unresponsive map after outside-click on a touch device with draggable:false (#335) * Implement workaround fix for mouseout event on touch devices * fix linting errors --- src/google_map.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/google_map.js b/src/google_map.js index 21035fa..76bde3d 100644 --- a/src/google_map.js +++ b/src/google_map.js @@ -639,6 +639,14 @@ export default class GoogleMap extends Component { this_.mouseInMap_ = true; }); + // an alternative way to know the mouse is back within the map + // This would not fire when clicking/interacting with google maps + // own on-map countrols+markers. This handles an edge case for touch devices + // + 'draggable:false' custom option. See #332 for more details. + maps.event.addListener(map, 'click', () => { + this_.mouseInMap_ = true; + }); + maps.event.addListener(map, 'mouseout', () => { // has advantage over div MouseLeave this_.mouseInMap_ = false; this_.mouse_ = null;