mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
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
This commit is contained in:
parent
956c0ca5d2
commit
5c9d911e4f
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user