jacomyal / sigma.js

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges
https://www.sigmajs.org/
MIT License
11.28k stars 1.59k forks source link

MouseMove event does not fire from within a Web-Component (ShadowDom) #1441

Closed benny-noumena closed 2 months ago

benny-noumena commented 4 months ago

Hey there

First of all, sorry for not following protocol with Bug-Reporting but I have little time right now and would like to get a feedback so I can proceed with a PR if needed. I spent some time to figure out why the mousemove event was not working for me when I was using sigma.js within a lit web-component.

I did some debugging and narrowed it down to the mousemove and mouseup events being registered directly on the document, rather than on the container element.

What is the reason behind this?

If I change it to the container element everything works as expected for me.

Would it be safe to do so? Because then I would proceed and make a PR.

Many thanks for all the hard work!

Best Ben

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

benekeil commented 2 months ago

it would be great if all events were also supported for the shadow dom

jacomyal commented 2 months ago

Hi,

@sim51 just pushed a fix implementing suggestion from @foxton9 on issue #1400.