zcreativelabs / react-simple-maps

Beautiful React SVG maps with d3-geo and topojson using a declarative api.
https://www.react-simple-maps.io/
MIT License
3.04k stars 424 forks source link

Panning in mobile devices breaks after first interaction #244

Closed pedrommarquesm closed 3 years ago

pedrommarquesm commented 3 years ago

Chrome, used in OnePlus 7.

When I zoom (by pinching the device screen), or slide across the map, I am not able to repeat these actions.

This can be reproduced in a browser using the dev tools with mobile device mode one (toggle device toolbar).

https://user-images.githubusercontent.com/54754249/103585687-70ab2200-4edb-11eb-9316-b125a56891e7.mov

Any help with this issue would be cool!

Thanks

pedrommarquesm commented 3 years ago

After some debugging, with some luck I found out that by upgrading from react@16.3.1 to @17.0.1 solves this issue (on my project)

Even though this lib already has the latest React version, the example in this lib website, featuring zooming/panning is broken.

By opening this [example] on a mobile device (https://www.react-simple-maps.io/examples/zoom-pan/) (preview link of the sandbox: https://8ithq.csb.app/ ), we can check the examples are running with React@16.8.6, which solves this issue by upgrading to React@17.0.1

zimrick commented 3 years ago

Updated the example, should be ok now, thanks for flagging this @pedrommarquesm