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

Custom events not working properly #2490

Closed
cemrehancavdar opened this issue Apr 22, 2023 · 1 comment
Closed

Custom events not working properly #2490

cemrehancavdar opened this issue Apr 22, 2023 · 1 comment

Comments

@cemrehancavdar
Copy link

I have noticed that custom events are not functioning correctly in StackBlitz. When emitting a custom event with attributes, only the "isTrusted" attribute is present, with a value of "false". This behavior is unexpected and not consistent with other environments where custom events are supported. They are working properly in local and CodeSandbox environments.

Steps to reproduce:

  • Open the StackBlitz project below.
    
  • Click the map.
    
  • Check the event object received in the listener function.
    

Stackblitz project: https://codesandbox.io/s/elated-firefly-ooxo0z?file=/index.html

Result:
CustomEvent{isTrusted: false} isTrusted: false <prototype>: CustomEvent

Expected:
CustomEvent {isTrusted: false, initCustomEvent: ƒ initCustomEvent(), detail: Object, composedPath: ƒ composedPath(), stopPropagation: ƒ stopPropagation()…} ...

The code produces the event:
function setMapEvents(map) { map.on('click', (e) => { const event = new CustomEvent('map:click', { detail: { point: e.latlng } }); window.dispatchEvent(event); });
https://github.com/cemrehancavdar/hyperleaflet/blob/master/src/Geometry/events.js

Copy link

Apologies that we were unable to address this issue in a timely manner!

Given that we have millions of free users this has been a challenge, and we are working to improve over time. As part of an effort to focus on driving the most recent issues to resolution, this issue is being closed.

If this issue is still meaningful, please comment with an update and re-open the issue for troubleshooting! Thanks for your continued loyalty to the StackBlitz platform over the years!

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

No branches or pull requests

2 participants