Open hnrq opened 2 years ago
Which replacement not work? I try to replace one, it's work because we listen events on document.
Hmmm. That's probably because you kept this line. I was thinking about also removing these targets that are being passed to the Event itself
It seems we need to check all sensorEvent.target
and related logic to achieve this replacement. Like https://github.com/zjffun/draggable/commit/6cf6e81266d8e8458c7fb4f8a641e136fa3e7813
Mainly need to check the logic of source element and original element. See #242
I'm still playing around with this lib and I saw that SensorEvents are usually triggered in source container and the
target
itself is set inside the event's details. This causes some errors when trying to use Happy DOM for testing, because target should be set once the event is dispatched and should not be overriden.However, everything breaks when triggering Sensor Events on the target itself instead of the container and I'd like to do this replacement here, because it feels like it's the right pattern imo. Any ideas for making this replacement?