New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map not responsive after click outside the map when on touch device and draggable:false option #332
Comments
I have almost zero knowledge about tap devices and their events, any help will be very appreciated. |
@istarkov I am unable to find the cause for this problem since it reproduces without apparent logic. Although I have a feeling it has to do with #233 fix that was applied and following what I read in #297. |
@istarkov I have some new information. After removing the #233 fix this problem still occurs. While I was at the code I put the following traces:
And indeed, normal click on the map produces both trace lines. After clicking outside the map (some other div) only the first line is logged. Now adding these two lines:
Would show that on mobile touch devices - clicking outside the map would (stupidly) produce a "mouseout" event but would never produce a corresponding "mouseover" event. However adding this logging line:
shows that map click is logged on mobile (why not). So doing:
Within that handler seems to solve that problem since any tap on the top div would fire the click event and notify the component that "mouse is over again" in a different way. Let me know if this seems a reasonable analysis and workaround - I know you do not plan to make this component 100% mobile ready and I am no expert to know how should that be done correctly. |
I wrote that
As you see the codebase is a big hack around google map api ;-) So what can we do with mobile having that mouseover never occurred, I don't know ;-) |
Sometimes I think that the best is to setup internal tile server and use something beautiful written on react like https://github.com/mariusandra/pigeon-maps |
@istarkov I trust you - If you write it - I will use it 🤡 To the point, since currently it's 100% broken on mobile - if we can improve mobile without affecting desktop that would seem like a good step. the google maps |
Initially this control was written for MapBox map, but that time webgl was at near 70% of computers. And my client had the computer from that other 30%. So instead of very good MapBox solution I wrote this. Seems like your solution is reasonable,. Ill accept a PR |
For future reference - The reason we need to activate it is the following:
Warning If you are using native google map markers and on a touch device - clicking outside the map component and than on a marker would NOT be considered a click from the point of view of this wrapper component. So all the "children mouse logic" would not work.. (although this is assumed to be a weird setup). |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I may have found the wrong reproduction of this problem but I modified an old JSBin to show the problem:
Currently checked on chrome dev tools using the "mobile" tap input emulation.
https://jsbin.com/wihaxezera/edit?js,console,output
After the map loads - tapping the marker would produce a double "click" console log.. (should not be double)
Then, clicking on the red area to the right (just outside the map div container) would make click event to never fire again.
When removing either
draggable:false
orfullscreenControl:false
this behaviour is not observed.Did not have a chance to test yet on an actual mobile device..
The text was updated successfully, but these errors were encountered: