Search code examples
javascriptangularjsgoogle-mapsmobileng-map

Google maps with ngmap mobile issue


I'm using google maps with ngmap in an angular application and I'm having an issue with a custom marker.

My custom marker has an input field inside to set a custom name for my location. The problem is that on mobile (Android & iOS) I cannot access this field to write into. (Basically I cannot tap on the input field) Do you have any idea on why would that happen?

I've got my code here to see this thing in action.


Solution

  • You can try this:

    HTML:

    <div class="infobox">
      <div class="infobox__custom-name">
        <input autofocus type="text" ng-model="vm.eventLocation.name" ng-click="vm.click($event)">
      </div>
      <div class="infobox__address">{{vm.eventLocation.address}}</div>
    </div>
    

    JS:

     vm.click = function(e) {
        e.target.focus();
      }