Skip to content
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

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

Open
DzmVasileusky opened this issue Oct 15, 2019 · 0 comments

Comments

@DzmVasileusky
Copy link

DzmVasileusky commented Oct 15, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant