Comments (14)
Yay! The issue is fixed with v2.0.8. Thanks a lot @SamSamskies 🎉
from react-map-gl-geocoder.
Thanks for reporting issue. Unfortunately, I don't have an Android to debug this. If anyone would like to tackle this issue, PRs are much appreciated.
from react-map-gl-geocoder.
@ExiaSR @SamSamskies I'm having the same issue too :( . This does not happen with mapbox-gl-geocoder
from react-map-gl-geocoder.
@thanhphuong612 if you can provide any information about what may be causing this, I can look into it. I don't have an Android phone, so I'm not even able to reproduce this issue. Other than that, feel free to spread the word to others that may have an Android phone and would be willing to help debug. Maybe they could fix it and send a PR or at least provide some insight into why this may be happening.
from react-map-gl-geocoder.
@SamSamskies thanks for looking into it.
It seems to me for some reasons on Android, componentDidUpdate
is called 3 times when the input gets focused, and after that the keyboard disappears and the input lost focused because the geocoder is removed inside componentDidUpdate
It looks like componentDidUpdate
does not get called for desktop or iPhone.
The issue happens on your demo https://codesandbox.io/s/l7p179qr6m as well, but here is the screenshot I'm debugging live content my app on an android phone from my Mac Dev Tool.
from react-map-gl-geocoder.
@thanhphuong612 thanks, this is helpful. I'll try and take a look at this this weekend.
from react-map-gl-geocoder.
@thanhphuong612 could you try this demo to see if the issue still occurs? https://codesandbox.io/s/v0m14q5rly
from react-map-gl-geocoder.
@thanhphuong612 I improved the rendering by changing the component to a PureComponent in v2.0.8, so now the component only updates when the props change. I think this problem may go away as long as you're not passing in new object references or anonymous functions as props. Let me know if it fixes the problem or not.
from react-map-gl-geocoder.
@SamSamskies thanks for looking into this. Unfortunately the issue is still not fixed.
I tried to debug and see that the removeGeocoder
is still called in componentDIdUpdate
from react-map-gl-geocoder.
@thanhphuong612 it is supposed to do that. However, v2.0.8 only re-renders when the props have changed. So componentDidUpdate should only change when you change the props. Can you post a code snippet of the JSX for your Geocoder component?
You may also need to ignore mouse interaction events on the Geocoder component. I posted an example of how to do that in this issue #22.
from react-map-gl-geocoder.
@SamSamskies I have tried your demo https://codesandbox.io/s/v0m14q5rly with v2.0.8, and the issue is not fixed yet on this demo.
I haven't tried v2.0.8 on my code yet.
If you do not have Android phone, you can try https://www.browserstack.com/. It offers the ability to test on Android device for free. I can reproduce the issue on browserstack as well.
from react-map-gl-geocoder.
@thanhphuong612 the demo you linked is using version v2.0.5. Try it with this one https://codesandbox.io/s/react-map-gl-geocoder-ignore-events-example-x652y. If that doesn't work, I'll try and look into it more using BrowserStack maybe this weekend.
from react-map-gl-geocoder.
@thanhphuong612 the demo you linked is using version v2.0.5. Try it with this one https://codesandbox.io/s/react-map-gl-geocoder-ignore-events-example-x652y. If that doesn't work, I'll try and look into it more using BrowserStack maybe this weekend.
Doesn't work for react hooks
Pls help
from react-map-gl-geocoder.
@thanhphuong612 the demo you linked is using version v2.0.5. Try it with this one https://codesandbox.io/s/react-map-gl-geocoder-ignore-events-example-x652y. If that doesn't work, I'll try and look into it more using BrowserStack maybe this weekend.
Doesn't work for react hooks
Pls help
Hi @sajmaru, could you provide a Code Sandbox example? It should work when using functional components and hooks.
from react-map-gl-geocoder.
Related Issues (20)
- GeoCoder Marker's Styling Not Working HOT 2
- Search Results Not closing, and marker not dropping HOT 9
- Geocoder doesn't appear in Next.js app HOT 1
- Console error passing object to marker prop
- Suggestions are displayed after setting a default input HOT 3
- External geocoder HOT 1
- React 17? HOT 1
- how to active draggable after search HOT 1
- mapbox-gl neccessary dependency? HOT 1
- How to get the current value? HOT 3
- Typescript import issue HOT 1
- Supporting stand-alone Geocoder without map ? HOT 1
- react-map-gl 7 support HOT 7
- Multiple input options in react app HOT 1
- export 'FlyToInterpolator' (imported as 'r') was not found in 'react-map-gl' HOT 2
- Request to upgrade transitive dependency `http-cache-semantics` in `react-map-gl-geocoder` HOT 1
- Menu stays open HOT 2
- Upon passing Marker="true" into geocoder, no point appears HOT 4
- TypeError: Cannot read property 'remove' of undefined __ Cannot read property 'addControl' of null - HOT 6
- Can Not Use react.map.gl.gecoder with Typescript HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-map-gl-geocoder.