ng2-ui / map

Angular Google Maps Directives
https://ng2-ui.github.io/map
260 stars 98 forks source link

mapClick and click events works like they set with useCapture on touch screen #291

Open DzmVasileusky opened 5 years ago

DzmVasileusky commented 5 years ago

Steps to reproduce

<ngui-map center="Brampton, Canada" (click)="onMapClick()">
      <custom-marker position="will-fall-back-to-brampton-canada"
        [geoFallbackPosition]="[43.73154789999999, -79.7449296972229]">
            <img src="marker-icon.svg" (click)="onInnerElementClick($event)" />
      </custom-marker>
</ngui-map>
onMapClick () { console.log('Map clicked'); }
onInnerElementClick (event) { 
      event.stopPropagation();
      console.log('Inner clicked'); 
}

Current behavior

Console output will be

console.log('Map clicked');
console.log('Inner clicked');

Expected/desired behavior

Propagation without useCapture should work from inner element to outer. And stopPropagation should prevent parent click handler. Output should be: console.log('Inner clicked');

Other information

If I use (touchend) it works like expected.