Skip to content

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

Description

@DzmVasileusky

Steps to reproduce

  • Create a map with inner element which have click event handler
  • use event.stopPropagation() in child element event handler
  • open app on touch device (IPad for example or event Chrome touch emulation)
  • click on child element
<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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions